locked
How to let OAuth2 webiste user account login my Website ? RRS feed

  • Question

  • User1735516446 posted

    I find it's easy to let Twitter,Facebook,Google and microsoftAccount external login by OAuth2, only  uncomment the following lines like this :

               app.UseCookieAuthentication(new CookieAuthenticationOptions
                {
                    AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                    LoginPath = new PathString("/Account/Login")
                });
                app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
    
                // Uncomment the following lines to enable logging in with third party login providers
                app.UseMicrosoftAccountAuthentication(
                    clientId: "0dd000******************",
                    clientSecret: "BsW****************");
    
                app.UseTwitterAuthentication(
                   consumerKey: "**",
                   consumerSecret: "**");
    
                //app.UseFacebookAuthentication(
                //   appId: "",
                //   appSecret: "");
    
                //app.UseGoogleAuthentication();

    But how to let other website users login my website though Oauth2?   the website have provide Oauth2  and it can provide  Web API like :https://graph.qq.com/oauth2.0/token?grant_type=authorization_code&client_id=[YOUR_APP_ID]&client_secret=[YOUR_APP_Key]&code=[The_AUTHORIZATION_CODE]&state=[The_CLIENT_STATE]&redirect_uri=[YOUR_REDIRECT_URI]   return : access_token=YOUR_ACCESS_TOKEN&expires_in=3600

     

    Sunday, November 9, 2014 5:07 AM

Answers

All replies