-
Notifications
You must be signed in to change notification settings - Fork 92
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
OriginHeaderDoesNotMatchKey w/ Successful Auth Code #71
Comments
Try having the post body in this format "grant_type=authorization_code&code={authCode}" |
Iiiiinteresting - when dropping the trailing slash I get:
Now I'm curious about trying a few different paths in case it is indeed a redirect issue. Thanks for the help this far! |
Heres a few things to check for all endpoints.
IE - Forgetting any of those cause Bungie to do a redirect to proper one, which sometimes drop valuable header information. |
I was also having this issue when using the fetch API. The response origin the request returns is also "null" so that doesn't really help. For the time being I've set my origin to * while I work locally, but I'd also love to see a long term fix. |
Making really good progress - I'll be posting examples using Auth0 if I can get this last step working. I'm trying to get a refresh token using the following:
When I post this immediately after receiving a valid access token from my authorization code, however, I get this:
I'm using the exact same endpoint for my initial token request and the refresh. Any ideas? |
Okay, I think that I'm getting a valid refresh token back now, but when I make a protected call I get the following: Here's my AJAX call:
|
Can you inspect the response for a Cookie header and dig out the 'bungled'
value? I think that's what Thorn et al. can use to see, server-side,
exactly why you were refused.
…On Sun, Sep 10, 2017 at 9:29 PM, CK Hicks ***@***.***> wrote:
Okay, I *think* that I'm getting a valid refresh token back now, but when
I make a protected call I get the following: 401 - Unauthorized: Access
is denied due to invalid credentials.
Here's my AJAX call:
$.ajax({
type: 'GET',
url: 'https://www.bungie.net/Platform/Destiny2/1/Profile/4611686018435819655/?components=101',
headers: {
'X-API-KEY': [redacted]',
'Authorization': 'Bearer ' + [token]
},
data: '',
complete: function(res) {
console.log(res);
}
});
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#71 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAFqDDNSlgNmgUQvA4_asmOansa52L09ks5shLcsgaJpZM4PQs8r>
.
|
Ooooookay, I think I have this figured out using client-side scripts to get/refresh tokens. Thanks to everyone for the help - this kinda opened up a new set of needs for JS solutions that provide an easy auth flow. I'm considering filling that with a free service of some kind so others can just jump in and build. More later! |
Hmm, yeah share here what the issues ended up being and how you worked around them - if there's things we can do on our side that aren't meeting oauth spec for example and are preventing this from working without a hassle, perhaps we can help! |
Yeah! See the screenshot above for the the Auth0 configuration I used in a "Custom Social Extension" for the initial OAuth handshake. I then captured that using their embed tools as follows:
...which I then promptly broke as I dug into protected resources and refreshing my own tokens after expiry. 🙈 I left a few more notes on #45 as well, but what's frustrating for client-side authorization is the desire to keep secret things secret, while also making sure new devs can spin up their toolsets easily. Passing the various headers and body parameters isn't intuitive, though I'm sure it complies with spec just fine. I have a heart for folks wanting to jump in and build so long as they know the basics. Honestly, what I'd love to do is see what the DIM crew has made become something plug-and-play. Wrapping that in a small library that devs could drop into their JS apps could make things a lot simpler for the next wave of ideas to come to life. As always...thanks so much for your assistance. I can't say how cool it is to play and dev Destiny at the same time. Sometimes I don't know which is more fun! |
I really hope that I'm missing something simple here. I can get a valid auth code with the proper state parameter back from my application, but when I try to hit
/Platform/App/GetAccessTokensFromCode
I get the following:My app has an Origin Header as follows:
Here's my token request using jQuery:
...what am I missing? 😆
The text was updated successfully, but these errors were encountered: