waqaskhan540 / identityserver-token-exchange

A solution for exchanging external (Facebook,Google,Twitter etc) tokens with IdentityServer access token.
GNU General Public License v3.0
15 stars 20 forks source link

unsupported_grant_type exception #8

Closed senzacionale closed 5 years ago

senzacionale commented 5 years ago

I am using "external" for grant type but I am getting unsupported_grant_type exception.

Error in log: Client does not have the custom grant type in the allowed list, therefore requested grant is not allowed

You need to add own custom grant type: Howto: http://docs.identityserver.io/en/latest/topics/grant_types.html

waqaskhan540 commented 5 years ago

Could you please share your identityserver config for the client ?

senzacionale commented 5 years ago

Problem is that you need to add own custom grant type "external" in client config and then it will work http://docs.identityserver.io/en/latest/topics/grant_types.html

I set it now as

AllowedGrantTypes = new List<ClientGrantType> { new ClientGrantType { GrantType = GrantType.ResourceOwnerPassword }, new ClientGrantType { GrantType = GrantType.Hybrid }, new ClientGrantType { GrantType = GrantType.ClientCredentials }, new ClientGrantType { GrantType = "external" } },

Thank you for hint!

waqaskhan540 commented 5 years ago

Glad to see you resolved the issue