Reach claims from external provider in OpenIdConnectAuthenticationNotifications #821
Comments
I assume the upper code is in idsrv - the lower is your app? |
Right now it's all in the Startup class of the project that holds a self hosted idsrv. This is the full class
I'm quite a noobie with authentication and authorization, I hope I haven't misunderstood the guide... |
As I wrote in the walkthrough - putting idsrv and the client in the same application is just an option for development time - you might find it easier to separate them (to make things clearer what belongs where). wrt your question - to "copy" claims from facebook to the idsrv identity you need to use the idsrv user service - the in-memory one does that (again only suitable for testing). Maybe familiarize yourself with the source code of the InMemoryUserService first (AuthenticateExternalAsync in particular). |
Of course I'm just testing, and yes I'm using the In-Memory users, once I'm fluent with concept and api I'll surely begin to divide and organize the code, I just need to understand first if what I need to do can be implemented and how :) |
Hello, I'm trying to follow your simple guide mvcGettingStarted.
Now, I've implemented both GoogleAuthentication and FacebookAuthentication providers, and everything is working as expected, I actually can log-in, and if I sign in with my identity server I also got the Role claims per user.
I was wondering, what if I want to keep all the claims given from the external providers?
Simple example.
This is how my facebook provider setup looks like:
In the foreach loop I', trying to store all the facebook claims in the Identity, but when I get back in the SecurityTokenValidated callback, my Identity hasn't them.
Is it because I'm manipulating two different Identites?
Is there a right way to achieve what I am trying to do?
Thank you.
The text was updated successfully, but these errors were encountered: