Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IdentityServer Using Implicit or Hybird #1043

Closed
marjezhang opened this issue Apr 24, 2019 · 3 comments
Closed

IdentityServer Using Implicit or Hybird #1043

marjezhang opened this issue Apr 24, 2019 · 3 comments

Comments

@marjezhang
Copy link

The Logining isn't working when i try to use Implicit or hybird in identityserver.

The identityserver is running,but when client is redirect to login page,and then commit login, and then Redirect back to login in circulation, it can't rediret to consent page.

@maliming
Copy link
Member

This seems to be related to Identity Server.
Can you see what's in the application log?

@marjezhang
Copy link
Author

excuse, this problem always have been right there. May be it is Abp.IdentityServer bug.
Beacause I use simple project only with IdentityServer4's Demo to run. The result is Success.
but i use project with volo.abp.IdentityServer's Template to run. The result is fault.

My enviremnet following:

IdentitServer: volo.Abp's Template in abp.io for Creating Style: without UI

TestClient: aspnetcore.Mvc
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using System.IdentityModel.Tokens.Jwt;

The Problem is Implicit Or Hybrid can't work.
when i click the link in mvc's web ,then it return url like this, but page is wrong

Request URL: http://localhost:5000/connect/authorize?client_id=Mvc-Testclient&redirect_uri=http%3A%2F%2Flocalhost%3A5002%2Fsignin-oidc&response_type=code&scope=openid%20profile%20api1%20api2%20roles%20offline_access&response_mode=form_post&nonce=636927436848344986.YzY2YjZlYjMtM2I1Ni00MDUzLWFiNWYtYmY2YTA1NmNjMDUxYzkzMGEzNjMtNjE0NS00YmE1LThlMDctMjE2ZTZjYWFjOWI0&state=CfDJ8FO3MMSAAqxJvl2_YhgYlncxnAmAZqqAaqgagYuMagW6WsyeR6G_Odw5qjdMNrd_GI7vINLKaNgnAIyygQe4gchBor0AbaovFMiFbDQHKSzGB6vAsb3hBnjbPUKehDPMF4Rm0Jiqn8-THGPSk033ospZYM_afDCnEXkgUNYXbmPSlK6dLvJVQDTd9HEwGimG46WWzVeIfaKuubO-2CjqnmQLXd-RgFtz0OgmBJThJi1CLY84RkgtuDLKkRRwOEDqgCYmCrSvn6s77RYO1g-KP09JaO2cEiEKcyWDmriY2Z6LJhWRdezeDJUiShqxV4pIi2GCLyVf7AVquJar7Ao_j0E&x-client-SKU=ID_NETSTANDARD1_4&x-client-ver=5.2.0.0

The Identityserver DataSeed Client is right, like :


var client = new Client(
                Guid.NewGuid(),
                "Mvc-Testclient"
            )
            {
                ClientName = "Mvc-Testclient",
                ProtocolType = "oidc",
                Description = "test-client",
                AlwaysSendClientClaims = true,
                AlwaysIncludeUserClaimsInIdToken = true,
                AllowOfflineAccess = true,
                SlidingRefreshTokenLifetime = 3600,
                AccessTokenLifetime = 1800,
                RefreshTokenExpiration = (int)TokenExpiration.Sliding,
                AbsoluteRefreshTokenLifetime = 31536000 //365 days
                
            };

            client.AddScope("api1");
            client.AddScope("api2");
            client.AddScope("roles");
            client.AddScope(IdentityServerConstants.StandardScopes.OpenId);
            client.AddScope(IdentityServerConstants.StandardScopes.Profile);
            client.AddScope(IdentityServerConstants.StandardScopes
                .OfflineAccess);

            client.AddScope("unique_name");
            client.AddClaim("client1", "ClientClaimType1");
            client.AddClaim("client2", "ClientClaimType2");

            client.AddGrantType(GrantType.Hybrid);

            client.AddSecret("abc".Sha256());

            client.AddRedirectUri("http://localhost:5002/signin-oidc");
            client.AddPostLogoutRedirectUri(
                "http://localhost:5002/signout-callback-oidc");
            client.AddCorsOrigin("http://localhost:5002"); 


            await _clientRepository.InsertAsync(client);


@maliming
Copy link
Member

maliming commented May 6, 2019

Duplicate of #1097

@maliming maliming marked this as a duplicate of #1097 May 6, 2019
@maliming maliming closed this as completed May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants