Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

nexpected client assertion type #55

Open
lemmycaution opened this issue Apr 9, 2017 · 4 comments
Open

nexpected client assertion type #55

lemmycaution opened this issue Apr 9, 2017 · 4 comments

Comments

@lemmycaution
Copy link

Hi there,

I'm trying to run client_assertation_certificate_example but stuck with below error. It seems I'm missing something in configuration but cannot find it. Any tip most welcome, thanks a lot.

V, [2017-04-09T14:46:55.995211 #73458] VERBOSE -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: TokenRequest getting token for client for https://graph.microsoft.com/v1.0.
V, [2017-04-09T14:46:55.995686 #73458] VERBOSE -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: Creating self signed JWT payload. Expires: 2017-04-09 14:56:54 +0100. NotBefore: 2017-04-09 14:46:54 +0100.
V, [2017-04-09T14:46:55.995842 #73458] VERBOSE -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: Creating self signed JWT header with thumbprint: rWHKnQ53WQH79JiMnyGFarbTnSs=.
V, [2017-04-09T14:46:55.998631 #73458] VERBOSE -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: TokenRequest checking cache #<ADAL::MemoryCache:0x007fdc0f0e9be0> for token.
V, [2017-04-09T14:46:55.998705 #73458] VERBOSE -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: Searching cache for tokens by keys: [:authority, :client_id].
V, [2017-04-09T14:46:55.998781 #73458] VERBOSE -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: Validating 0 possible cache matches.
V, [2017-04-09T14:46:55.998841 #73458] VERBOSE -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: Looking through 0 matching cache entries for resource https://graph.microsoft.com/v1.0.
V, [2017-04-09T14:46:55.998893 #73458] VERBOSE -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: Attempting to obtain access token for https://graph.microsoft.com/v1.0 by refreshing 1 of 0 matching MRRTs.
I, [2017-04-09T14:46:55.998931 #73458]  INFO -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: Did not find token in cache.
V, [2017-04-09T14:46:55.999085 #73458] VERBOSE -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: Creating self signed JWT payload. Expires: 2017-04-09 14:56:54 +0100. NotBefore: 2017-04-09 14:46:54 +0100.
V, [2017-04-09T14:46:55.999177 #73458] VERBOSE -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: Creating self signed JWT header with thumbprint: rWHKnQ53WQH79JiMnyGFarbTnSs=.
V, [2017-04-09T14:46:56.001347 #73458] VERBOSE -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: Creating self signed JWT payload. Expires: 2017-04-09 14:56:55 +0100. NotBefore: 2017-04-09 14:46:55 +0100.
V, [2017-04-09T14:46:56.001411 #73458] VERBOSE -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: Creating self signed JWT header with thumbprint: rWHKnQ53WQH79JiMnyGFarbTnSs=.
V, [2017-04-09T14:46:56.003526 #73458] VERBOSE -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: Resorting to OAuth to fulfill token request.
V, [2017-04-09T14:46:56.201593 #73458] VERBOSE -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: Attempting to create a TokenResponse from raw response.
E, [2017-04-09T14:46:56.201842 #73458] ERROR -- a2a72bbd-a2f9-4276-baf3-6362e13b3821: Parsed an ErrorResponse with error: invalid_request and error description: AADSTS90023: Unexpected client assertion type.
Trace ID: cffebcfe-402c-48bf-b90b-8a2b765e4200
Correlation ID: a2a72bbd-a2f9-4276-baf3-6362e13b3821
Timestamp: 2017-04-09 13:46:55Z.
Failed to authenticate with client credentials. Received error: invalid_request and error description: AADSTS90023: Unexpected client assertion type.
Trace ID: cffebcfe-402c-48bf-b90b-8a2b765e4200
Correlation ID: a2a72bbd-a2f9-4276-baf3-6362e13b3821
Timestamp: 2017-04-09 13:46:55Z.
@akrulwich
Copy link

Seeing the same issue. @lemmycaution did you ever resolve this?

@lemmycaution
Copy link
Author

lemmycaution commented Jul 3, 2017 via email

@akrulwich
Copy link

@lemmycaution Thanks

@kule
Copy link

kule commented Aug 21, 2017

I had this it's an easy fix - if you look through the code of the dotnet version, it uses a different JWT_BEARER string:

https://github.com/AzureAD/azure-activedirectory-library-for-dotnet/blob/2e528e99d50ea3176c968ea95820f6c033b48b59/src/Microsoft.IdentityModel.Clients.ActiveDirectory/Internal/OAuthConstants.cs#L73

Someone's already done a pull request too: #39

In the meantime you can monkey patch the gem to fix:

module ADAL
  class TokenRequest
    module GrantType
      JWT_BEARER = 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'
    end
  end
end

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants