Hi, I’m working on a component integration and I need to use the ManualMipTokenCache which seems to be introduced in the SDK from version 2024 R2.
ManualMipTokenCache tokenCache = new ManualMipTokenCache(token);
VideoOS.Platform.SDK.Environment.AddServerOAuth(
secureOnly,
managementServerUri,
tokenCache,
masterOnly: true);
VideoOS.Platform.SDK.Environment.Login(
managementServerUri,
integrationId,
integrationName,
version,
manufacturerName,
masterOnly: true);
My question is if this code will work against an older system than 2024 R2, especially 2024 R1. As I remembered the OAuth support was introduced much earlier, right?
I do not think this has been systematically tested here at Milestone, but yes, it should work in older systems, we are confident it will work in 2024 R1.
Great, I was just looking for your best guess. Thank you, Bo
@Bo Ellegård Andersen (Milestone Systems) - an additional question regarding this. I notice that my implementation of audit logging using ManualMipTokenCache for the login operation always creates User entries like this: “[BASIC]\username” also when the user is actually a Windows-domain user. When using the LogOnServer sample it correctly shows “[DOMAIN]\username”. Could this be related to me using ManualMipTokenCache?
Tested on 2024 R2.
See my login code in the original post.
The observation is correct, when using ManualMipTokenCache there is only one type of user associated with it so you cannot distinct if it’s AD, basic or external (as we only get the access token when creating an instance of that object). LogOnServer is not using Environment.AddServerOAuth explicitly (because it’s using DialogLoginForm) so it’s probably a bad example.
If you want to use OAuth token and distinct between types of users, you should use VideoOS.Platform.SDK.OAuth.MipTokenCache class instead of ManualMipTokenCache.
The ConfigAddCameras sample uses MipTokenCache - https://doc.developer.milestonesys.com/mipsdk/index.html?base=samples%2FComponentSamples%2FConfigAddCameras%2FREADME.html&tree=tree_2.html