IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

sub claim is missing when login with different login page in the solution

Open RajasekarPR opened this issue 8 years ago • 3 comments

Hi Team,

I have included the Identity Server as separate module in my another project. I have login screen which accepts username and password, When i am try to login with login page, I am getting subclaim is missing from IIdentityAuthenticationService.cs file (Line Number : 130)

I want to supress Identity Server SignInAsync method calling in Identity Server Module. How to do so ?

Kindly do the needful.

RajasekarPR avatar Aug 28 '18 13:08 RajasekarPR

This usually happens when you don't have the default authentication scheme set to the same scheme you use on your login page.

brockallen avatar Aug 28 '18 13:08 brockallen

Hi @RajasekarPR , have you resolved this bug? Can you guide me how to do? This is my code

services.AddAuthentication(options =>
            {
                options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
            })
                .AddCookie(options =>
                {
                    options.LoginPath = "/Account/Login";
                    options.AccessDeniedPath = "";
                    options.SlidingExpiration = true;
                    options.Cookie.Expiration = TimeSpan.FromDays(1);  
                })
                .AddIdentityServerAuthentication("TestKey", options =>
                {
                    options.Authority = "http://localhost:52398";
                    options.ApiName = "api1";
                    options.SupportedTokens = SupportedTokens.Both;
                    options.RequireHttpsMetadata = false;
                })

This is in Login page await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, principal);

huanbd avatar Oct 31 '18 01:10 huanbd

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 12 '20 20:01 lock[bot]