"#" in google OAuth callback url instead of "?" - google-oauth

I am trying to used OAuth,
I have a front end of html page which calls https://accounts.google.com/o/oauth2/v2/auth
which then gives the response of 302 with redirect_url
https://oauth2.example.com/callback#access_token=4/P7q7W91&token_type=Bearer&expires_in=3600
this request have '#' instead of '?' for a query param i am unable to redirect that hash with the whole url in backend.
below is the link for the docs ๐Ÿ‘‡
https://developers.google.com/identity/protocols/oauth2/javascript-implicit-flow#handlingresponse
can anybody help with the answer?

Related

Why is Twitch OAuth redirecting to a link with query strings separated by โ€˜#โ€™?

I am creating a user login with the OAuth. Everything seems to work fine but Twitch redirect URI is messed up by the # where ? has to be.
My redirect URI:
https://localhost:7681/authorize
URI Twitch redirects to:
https://localhost:7681/authorize#access_token=43r99nhmxhvpckr4zrtb0sbx1q6tdg&scope=user%3Aread%3Aemail&state=%24%7Bdata.uid%7D&token_type=bearer
I already tried adding a trailing slash, nothing changed.
Did someone else encounter such behavior?
you requested a token for type token instead of a token of type code
token aka Implicit Auth is for client side apps and will generte and
return a access token via location hash
https://dev.twitch.tv/docs/authentication/getting-tokens-oauth#implicit-grant-flow
โ€œNormalโ€ oAuth, aka " Authorization code grant" will return a ?code
that is to be exchanged for an access token.
https://dev.twitch.tv/docs/authentication/getting-tokens-oauth#authorization-code-grant-flow
Essentially your <a href triggered the wrong token flow
Additionally you should never post generated access tokens publically.
Since someone can take it and abuse it or just revoke it. Or in this
case acquire your private email address.
https://discuss.dev.twitch.tv/t/why-is-twitch-oauth-redirecting-to-a-link-with-query-strings-separated-by/37976/2

Why won't trello REST API return an oauth token during authorization?

This is the URL I'm using to get oauth token https://trello.com/1/authorize?expiration=never&name=Dashboard&scope=read&response_type=token&key={{API_KEY}}&return_url=https%3A%2F%2F{{PAGE_HOST}}%2Foauth2callback%3Fstate={{DASHBOARD_DWID}}.
I'm able to bring up Trello authentication window and when I click "allow" button I'm redirected to URL given in return_url. I am able to get the {{DASHBOARD_DWID}} from this URL but there is no oauth token anywhere. Am I doing something wrong or why am I not seeing this token anywhere?
Trello actually returns the access token attached as the anchor tag in the URL. It would look something like https://{{PAGE_HOST}}/oauth2callback?state={{DASHBOARD_DWID}}#token={{TOKEN}}. Since I'm receiving this response on the server I didn't see this anchor tag anywhere as only the browser see's this value by default.

eBay Developer Sandbox Auth Token

I have an issue with generating a sandbox auth token, I get redirected the following link:
https://signin.ebay.com/ws/eBayISAPI.dll?ThirdPartyAuthSucessFailure&ebaytkn=&tknexp=1970-01-01+00%3A00%3A00&username=testuser_jdawg)
once the request grant the application permission.
Which states the following message:
Thank YouHelp
Authorization cancelled
It's now safe to close the browser window/tab.
Has anyone else had this issue?
The ebay URL redirect after authentication is somewhat broken.
The default URL redirects are:
On Success: https://signin.ebay.com/ws/eBayISAPI.dll?ThirdPartyAuthSucessFailure&isAuthSuccessful=true
On Failure: https://signin.ebay.com/ws/eBayISAPI.dll?ThirdPartyAuthSucessFailure&isAuthSuccessful=false
You can also define your own URLs on the Auth tokens for eBay page of the developer site.
The problem is that ebay truncates any url you enter at the first ampersand (&) encountered. This breaks their own accept URL which ends with &isAuthSuccessful=true
To fix this all you have to do is encode the ampersand as %26. So you need to change their URLs to:
On Success: https://signin.ebay.com/ws/eBayISAPI.dll?ThirdPartyAuthSucessFailure%26isAuthSuccessful=true
On Failure: https://signin.ebay.com/ws/eBayISAPI.dll?ThirdPartyAuthSucessFailure%26isAuthSuccessful=false
Edit: As you noted, this does not affect whether or not the authorization is actually successful or not, just the message that the user sees. You can also apply this solution to your own URLs too if you don't want to use theirs.

linkedin oauth2.0 authorization invalid client id error

I am using linkedin api with oauth library. my request url for authorization is
https://www.linkedin.com/uas/oauth2/authorization/?client_id=75gq3kju41jx44&redirect_uri=https%3A%2F%2Flocalhost%2FSocial%2Flinkedin%2Fsettings&scope=r_basicprofile%2Cw_share&response_type=code&state=1436579926-c05e44
But it is giving me error of page not found where it is showing me invalid client id.please let me know where I am going wrong.I am working on localhost.
For getting rid of the page not found, remove '/' before '?'
https://www.linkedin.com/uas/oauth2/authorization?client_id=75gq3kju41jx44&redirect_uri=https%3A%2F%2Flocalhost%2FSocial%2Flinkedin%2Fsettings&scope=r_basicprofile%2Cw_share&response_type=code&state=1436579926-c05e44
LinkedIn's OAuth 2.0 authorization endpoint is:
https://www.linkedin.com/uas/oauth2/authorization # <-- no '/' at the end
There is no trailing slash in it. You should remove the trailing slash from your request url and it should work.
Final request url:
https://www.linkedin.com/uas/oauth2/authorization?client_id=75gq3kju41jx44&redirect_uri=https%3A%2F%2Flocalhost%2FSocial%2Flinkedin%2Fsettings&scope=r_basicprofile%2Cw_share&response_type=code&state=1436579926-c05e44

"Error in parsing the OpenID auth request" when realm and return URL start with HTTPS prefix

I'm trying to implement Google OpenID and use URLs starting with https:// for both the realm and the return URL. When I pass:
openid.realm=http://mysite.com
openid.return_to=http://mysite.com/CompleteLogin
it works just fine, but when I pass
openid.realm=https://mysite.com
openid.return_to=https://mysite.com/CompleteLogin
navigating to the resulting URL redirects to https://accounts.google.com/o/openid2/auth?lotsOfParamsHere with the following text:
Error: invalid_request
Error in parsing the OpenID auth request.
I've looked carefully through the documentation - all the examples use URLs starting with http://.
Is using https:// even supported for realm and return URL? How do I use them?