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

Problem different token types #180

Open
jjbier opened this issue Sep 2, 2013 · 10 comments
Open

Problem different token types #180

jjbier opened this issue Sep 2, 2013 · 10 comments
Assignees

Comments

@jjbier
Copy link

jjbier commented Sep 2, 2013

in response send
OAuth2::TOKEN_TYPE_BEARER = 'bearer'
in request check
OAuth2::TOKEN_BEARER_HEADER_NAME = 'Bearer';
suggesting
OAuth2::TOKEN_TYPE_BEARER = 'Bearer'
OAuth2::TOKEN_BEARER_HEADER_NAME = 'Bearer';

@alanbem
Copy link
Member

alanbem commented Sep 28, 2013

Does it create error/exception?

@jjbier
Copy link
Author

jjbier commented Oct 1, 2013

I have a client oauth2, It's connected with server that use
FOSOAuthServerBundle for authentication, Me client request a token and
retrieve this data for example:
{
"access_token":"YjY0ZjdkMTYwNjk5OWUwNjIxM2JlNmNkN2FlNmQ3Zjg2ZTJiNDQ0MWVkNzE4NzdjMTNkYmNmNjBiZmI0NmJlNg",
"expires_in":3600,
"token_type":"bearer",
"scope":"read-only",

"refresh_token":"Yjg4MjAyZmYzMTBkNTI4ZWVlYzkwYTczMTFhMjZjNTc3YTVjMjYxZjcyMWZhNDE2NWE2OGM4ZWUyZjQzNjAxYQ"
}

My client use the token type of request for send the response for example
Client send in header:

$header = 'Authorization ' . sprintf("%s %s", getTokenType(),
getAccesToken() );

getTokenType() return the token type of response this is "bearer" but in
FOSOAuthServerBundle we check : is the type of token "Bearer" ? (the token
type request and response have different case sensitive)
how the type token is not equal we send error "invalid_grant" I don't
remeber the error.

Sorry for me English, I don't know more, I hope you understand me

2013/9/29 Alan Gabriel Bem notifications@github.com

Does it creates error/exception?


Reply to this email directly or view it on GitHubhttps://github.com//issues/180#issuecomment-25309855
.

@vlastv
Copy link
Contributor

vlastv commented Oct 1, 2013

@alanbem RFC 6750 section 4 in example shown value "Bearer" to "token_type"
For example, Google API OAuth, also returns "token_type": "Bearer"

@jjbier
Copy link
Author

jjbier commented Oct 1, 2013

Ok the token_type as Bearer is correct, this isn't the problen, I have
error because in response the server (oauth2-php or FOSOAuthServerBundle)
send the token type 'bearer' with leter 'b' in minuscule and for
autheticate the server required that token type 'Bearer' with leter 'B' in
capital letter.

I think this is odd, I hope you understand me now, otherwise, this is not
very important, but I think best than if server send & request token_type
equal.

Thanks for you time.

2013/10/1 Vladislav Vlastovskiy notifications@github.com

@alanbem https://github.com/alanbem RFC 6750 section 4http://tools.ietf.org/html/rfc6750#page-10in example shown value "Bearer" to "token_type"
For example, Google API OAuth, also returns "token_type": "Bearer"


Reply to this email directly or view it on GitHubhttps://github.com//issues/180#issuecomment-25432723
.

@vlastv
Copy link
Contributor

vlastv commented Oct 1, 2013

@jjbier I understand your problem. I wrote my thoughts for @alanbem.

@jjbier
Copy link
Author

jjbier commented Oct 2, 2013

Ok Excuse me @vlastv I thought you did not understand, my English is awful.

2013/10/1 Vladislav Vlastovskiy notifications@github.com

@jjbier https://github.com/jjbier I understand your problem. I wrote my
thoughts for @alanbem https://github.com/alanbem.


Reply to this email directly or view it on GitHubhttps://github.com//issues/180#issuecomment-25492162
.

@vlastv
Copy link
Contributor

vlastv commented Oct 2, 2013

@jjbier I myself do not speak very much English, my native language is Russian :)

Sorry for offtopic

@alanbem
Copy link
Member

alanbem commented Oct 2, 2013

@jjbier everything was clear, thank you. Please, don't worry about your english it's fine.

I will look into this problem later this week.

@ghost ghost assigned alanbem Oct 2, 2013
@Redsandro
Copy link

So token_type response is still bearer although only Bearer is accepted. Did you get a chance to look into it? I cannot find the actual faulty response in a quick search within this repo; is there a dependency that causes this?

@marcovdkuur
Copy link

A workaround is to override the default token_type (which is bearer in lowercase' to Bearer (with an uppercase).

fos_oauth_server:
    service:
        options:
            token_type: Bearer

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

5 participants