We are working on Open ID authentication. For this we are using IdentityModel.OidcClient dll.
We want Access Token and IdentityToken. We can get both the tokens in one call using below code snippet
var result = await _oidcClient.LoginAsync(DisplayMode.Visible);
LoginAsync is not working. We need to pass IBrowser object in "var options = new OidcClientOptions". We are not able to get IBrowser object.
We created Web Service and we are able to get IdentityToken using below code
var state = await _oidcClient.PrepareLoginAsync();
Above code snippet is returning redirect URI and from that URI we are able to fetch IdentityToken. But here, we are facing issue while fetching Access Token from the "tokenendpoint".
Now, we are using Visual Web Part and using LoginAsync method by passing "System Browser", "Extended Browser" and "WabBrowser" as IBrowser object in OidcClientOptions. We are getting below error
ActiveX control '' cannot be instantiated because the current thread is not in a single-threaded apartment.
It seems either we are missing something or our approach is not appropriate. Please let us know if any other DLL can be used for the same functionality in C#.