LoginRadius Validating access token .net core

168 Views Asked by At

I am trying to validate my access token (not JWT) with LoginRadius, I can do the login but after when I call my API I always get unauthorized or different errors according to my Authentication configuration, I am using like this. I believe the authority url is not correct but I couldn't find any other

            services.AddAuthentication(options => {
                options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;
            })
            .AddCookie()
            .AddOpenIdConnect("login-radius", options => {
                // Set the authority to your Auth0 domain
                options.Authority = $"https://api.loginradius.com/identity/v2/auth/";

                // Configure the Auth0 Client ID and Client Secret
                options.ClientId = Configuration["ClientId"];
                options.ClientSecret = Configuration["ClientSecret"];

                // Set response type to code
                options.ResponseType = OpenIdConnectResponseType.Code;

                options.Scope.Clear();
                options.Scope.Add("openid");

                options.CallbackPath = new PathString("/callback");

                options.ClaimsIssuer = "loginradius";

                // Saves tokens to the AuthenticationProperties
                options.SaveTokens = true;
            });
2

There are 2 best solutions below

0
Teta On BEST ANSWER

My account didn't have access to few features

0
Sudhanshu Agarwal On

I believe you are trying to setup OIDC, and to configure it, please refer to the LoginRadius docs on OIDC, as it needs few things that need to be configured in the Admin Console and the correct authority URL: https://www.loginradius.com/docs/single-sign-on/tutorial/federated-sso/openid-connect/openid-connect-overview/#otheropenidfunctionality6

Please refer to the OIDC discovery endpoint, which provides a client with configuration details about the OpenID Connect metadata of the Loginradius App.

URL Format: https://cloud-api.loginradius.com/sso/oidc/v2/{sitename}/{oidcappname}/.well-known/openid-configuration