ging / fiware-idm-deprecated

DEPRECATED - Identity Manager - Keyrock
Apache License 2.0
18 stars 25 forks source link

Problems with auth token #28

Closed IAIS4EP closed 8 years ago

IAIS4EP commented 8 years ago

Please see this issue: https://github.com/IAIS4EP/fiware/issues/4

garcianavalon commented 8 years ago

Seems to be solved

asafnevo commented 8 years ago

Generating a successful Client Credentials grant login flow I received an access token from the server at:

http://account.lab.fiware.org

When trying to use the access token for querying /user end point I receive the following error

{"error": {"message": "object of type 'NoneType' has no len()", "code": 400, "title": "Bad Request"}}

Querying the same endpoint using an access token received with any other login flow works perfectly.

garcianavalon commented 8 years ago

@asafnevo when you say the other login flows do you mean the other oauth 2 grants?

I will check the Client Credential Grant

asafnevo commented 8 years ago

@garcianavalon That's correct. All 3 - code, implicit and password works perfectly.. but when using the access token generated by the Client Credentials Grant Type always return the error above

garcianavalon commented 8 years ago

Ok, fixed this in https://github.com/ging/keystone/commit/faa2a88d0db9c0f0b5d16af836b3ec37d568c61c Updated the docs too http://fiware-idm.readthedocs.org/en/latest/oauth2.html#get-user-information-and-roles

As I stated in the docs:

Be aware that if you used the Client Credentials Grant to obtain the token there is no such thing as an ‘authorizing user’ because of the nature of this grant. You can still use this endpoint to validate the token, but the JSON (if the token is valid) will be empty.

But it shouldn't break now :) Thanks for your report!

asafnevo commented 8 years ago

It does make sense. Thanks @garcianavalon !

billhu422 commented 7 years ago

@asafnevo How do you get the Client Credentials from idm ?I register an application in idm and,and get access token successfully in Authentication Code type ,But can not get access token in Client Credentials type.