MVC 4 OAuth - NotImplementedException

I recently started implementing OAuth in an ASP.Net MVC 4 project.

I wrote a custom membership provider. All methods are completed in this ExtendedMembershipProvider.

When you try to use an account to log in to your MVC 4 account, everything works fine by default. I have a problem: a line that calls:

OAuthWebSecurity.Login(result.Provider, result.ProviderUserId, createPersistentCookie: false)) 

The above throws a NotImplementedException. It seems strange that I know that all my membership methods are complete.

The stack trace shows anything before this code as โ€œexternalโ€, so I wonder where the problem is?

+4
source share
1 answer

I have the feeling that this is caused by not using the user profile provider. All OAuthWebSecurity methods seem to be trying to talk to the profile provider, as OAuth information is stored here.

I wrote my own repository methods to not use the OAuthWebSecurity classes and instead just used the โ€œresultโ€ to manually retrieve the information from DotNetOAuth.

+1
source

Source: https://habr.com/ru/post/1432441/


All Articles