I have a client url in which the open id authentication is implemented .How I can implement Open ID connect simply in UWP Win 10. Can I use web authentication broker for that? If yes how to do it using WebAuthenticationBroker? please provide example
Yes, WebAuthenticationBroker
is designed to be used with protocols like OpenID and OAuth.
Basically, in UWP you just need to call authentication method and pass request and callback URIs:
var webAuthenticationResult =
await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None,
requestUri,
callbackUri);
if (webAuthenticationResult.ResponseStatus == WebAuthenticationStatus.Success) {
//String for service response
var data = webAuthenticationResult.ResponseData;
...
} else {
...
}
System will show an overlay UI on top of your app asking user to provide his or her credentials to corresponding website. If credentials are right website will return callbackUri and access token. WebAuthenticationBroker will check callbackUri with the one you provided and if everything was correct you will get your token as a result.
I would also recommend to look at the following repositories on GitHub in case you need custom implementation with WebView: