question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use AspnetBoilerplate as OpenId Client (How to login with Identity Server) ?

See original GitHub issue

How can I log in with the identity server? when I use sample Codes the page refreshes infinitely after login. this is my AuthConfigurer.Config

JwtSecurityTokenHandler.DefaultMapInboundClaims = false;

            services.AddAuthentication(options =>
                {
                    options.DefaultScheme = "Cookies";
                    options.DefaultChallengeScheme = "oidc";
                })
                .AddCookie("Cookies")
                .AddOpenIdConnect("oidc", options =>
                {
                    options.Authority = "https://localhost:5009";

                    options.ClientId = "mvc";
                    options.ClientSecret = "secret";
                    options.ResponseType = "code";

                    options.Scope.Add("api1");

                    options.SaveTokens = true;
                });

Is there any working sample?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
ismcagdascommented, Dec 8, 2021

@behiunforgiven when the OpenID provider returns to your app, how do you handle the signIn process ? Normally, you should handle it similar to code below;

var externalLoginInfo = await _signInManager.GetExternalLoginInfoAsync();

if (externalLoginInfo == null)
{
    Logger.Warn("Could not get information from external login.");
    return RedirectToAction(nameof(Login));
}

var tenancyName = GetTenancyNameOrNull();

var loginResult = await _logInManager.LoginAsync(externalLoginInfo, tenancyName);

if (loginResult.Result == AbpLoginResultType.Success)
{
    await _signInManager.SignInAsync(loginResult.Identity, false);
    return Redirect(returnUrl);    
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Articles Tutorials | AspNet Boilerplate
Identity Server is an open source OpenID Connect and OAuth 2.0 framework. It can be used to make your application an authentication /...
Read more >
OpenID Connect Integration - aspnetboilerplate
OpenIdConnect. But if you want to be an open id connect server, it's a different thing. You can then use Identity Server for...
Read more >
Adding User Authentication with OpenID Connect
In this quickstart we want to add support for interactive user authentication via the OpenID Connect protocol to our IdentityServer. Once that is...
Read more >
how to implement IdentityServer4 integration? #6700 - Support
As my application need to login from another application automatically. ... ://aspnetboilerplate.com/Pages/Documents/Zero/Identity-Server.
Read more >
Modules/IdentityServer | Documentation Center | ABP.IO
This module persists clients, resources and other IDS-related objects to database. ... Note: You can not use IdentityServer and OpenIddict modules together.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found