Login with twitter using identity server is not working when using openidconnect

49 Views Asked by At

I'm attempting to integrate Twitter login functionality into my application using Identity Server. I've utilized AddOpenIdConnect for this purpose. Below is the code snippet I've employed:

authenticationBuilder
    .AddOpenIdConnect(Configuration.GetSection("ExternalLoginConfiguration:TwitterConfiguration:Scheme").Value, "twitter", options =>
    {
        options.SignInScheme = "Identity.External";
        options.ClientId = Configuration.GetSection("ExternalLoginConfiguration:TwitterConfiguration:ClientId").Value;
        options.ClientSecret = Configuration.GetSection("ExternalLoginConfiguration:TwitterConfiguration:ClientSecret").Value;
        options.CallbackPath = "/signin-twitter";
        options.Authority = "https://api.twitter.com/oauth/authorize";
        options.ResponseType = OpenIdConnectResponseType.Code;                   
        options.SaveTokens = true;
    });

However, I'm encountering an issue, which is

{ "StatusCode":500, "Message":"IDX20803: Unable to obtain configuration from: 'https://api.twitter.com/oauth/authorize/.well-known/openid-configuration'.,The server encountered an internal error, for more information please check the server error logs." }

Upon using AddTwitter, the login process is successful. However, I encounter difficulties in accurately retrieving access tokens.

0

There are 0 best solutions below