IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

ResourceOwnerPassword with ReferenceToken assumes secret type of NoSecret

Open xzidez opened this issue 10 years ago • 4 comments

Im trying to use referencetoken with a client of GrantType ResourceOwner. But as soon as i set AccessTokenType = AccessTokenType.Reference, I cannot use my API. The error I get is the following

fail: IdentityServer4.Validation.HashedSharedSecretValidator[0]
      Parsed secret should not be of type NoSecret
fail: IdentityServer4.Validation.SecretValidator[0]
      Secret validators could not validate secret
fail: IdentityServer4.Validation.ScopeSecretValidator[0]
      Scope validation failed.
fail: IdentityServer4.Endpoints.IntrospectionEndpoint[0]
      Scope unauthorized to call introspection endpoint. aborting.

This is how my Client looks

  public static IEnumerable<Client> GetClients()
        {
            return new List<Client>
            {
                new Client
                {
                    ClientId = "ro.client",
                    ClientName = "ro client",
                    AllowedGrantTypes = GrantTypes.ResourceOwnerPassword,
                    AccessTokenType = AccessTokenType.Reference,

                    ClientSecrets = new List<Secret>
                    {
                        new Secret("secret".Sha256())
                    },

                    AllowedScopes = new List<string>
                    {
                        "api1"
                    }
                }
            };
        }

Otherwise its pretty much the same as your examples. Ive tried using SupportedTokens = IdentityServer4.AccessTokenValidation.SupportedTokens.Reference, on my api configuration but it doesnt change anything.

The Identification and Api works fine as long as I dont use AccessTokenType.Reference on my client settings.

xzidez avatar Sep 16 '16 07:09 xzidez

Apparently the problem was because I didnt use AddConfigurationStore.

Edit: False alarm. I still can't get it to work properly with Reference token :(

xzidez avatar Sep 16 '16 08:09 xzidez

Have you set a scope secret for for your API?

leastprivilege avatar Sep 18 '16 10:09 leastprivilege

You are the correct. I had Scope secret but wasnt cleaver enough to actually use it in my API.. Thanks

xzidez avatar Sep 19 '16 14:09 xzidez

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 15 '20 14:01 lock[bot]