I have the following working Runtime SDK 100.x code implements application authentication:
ServerInfo serverInfo = new ServerInfo
{
ServerUri = new Uri(SERVER_URL),
TokenAuthenticationType = TokenAuthenticationType.OAuthClientCredentials,
OAuthClientInfo = new OAuthClientInfo { ClientId = CLIENT_ID, ClientSecret = CLIENT_SECRET, RedirectUri = new Uri(REDIRECT_URL) }
};
AuthenticationManager.Current.RegisterServer(serverInfo);
AuthenticationManager.Current.OAuthAuthorizeHandler = new OAuthAuthorize();
AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(CreateCredentialAsync);
As OAuthClientInfo is obsolete at 200.7, I have rewritten this as:
ServerInfo serverInfo = new ServerInfo(new Uri(SERVER_URL))
{
TokenAuthenticationType = TokenAuthenticationType.OAuthClientCredentials,
};
AuthenticationManager.Current.RegisterServer(serverInfo);
var userConfig = new OAuthUserConfiguration(new Uri(SERVER_URL), CLIENT_ID, new Uri(REDIRECT_URL));
AuthenticationManager.Current.OAuthUserConfigurations.Add(userConfig);
AuthenticationManager.Current.OAuthAuthorizeHandler = new OAuthAuthorize();
AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(CreateCredentialAsync);
How do I include Client Secret here so the users are not getting the authentication prompt? I understand I should be using OAuthApplicationCredential, but I cannot figure out how.
Thanks!