-
Notifications
You must be signed in to change notification settings - Fork 60
defaultHeadersForTokenRequests not working for updateToken() #358
Comments
Add some default headers to the baseConfig that will be appended when using .login() and .refreshToken(). This is to support IdentityServer 4 with the openId spec http://openid.net/specs/openid-connect-core-1_0.html#TokenRequest. Gives us the posibility to use application/x-www-form-urlencoded as content-type.
I've slightly changed your description (removed some typos and made the code snippet prettier). @groenlid you worked on this, correct? Do you have any input on this issue? :) |
Thank you, @RWOverdijk! I have been trying to find a work around this week, but I haven't got anywhere with it yet. Any input will be much appreciated! :) Thank you again! |
I think @groenlid is mia. I'll pin this to my own inbox and see if I can find time to tackle this. |
Thank you @RWOverdijk ! |
If you find the solution in the meantime, that'd be even better obviously :D |
Hi @RWOverdijk, Good news - defaultHeadersForTokenRequests works! Since the token endpoint was working outside the Aurelia App & removing defaultHeadersForTokenRequests broke the initial login (which was only due the default format being JSON), I had assumed it was the front end that was causing the error. Turned out I had to make adjustments in the token generation for it to accept requests from the App and everything works now. Thank you for responding to my comment and the issue! |
Oh I'm glad you solved it :) |
Hello,
@groenlid - @RWOverdijk suggested I should pin you to this issue.
Setting the defaultHeadersForTokenRequests seems to work for the login() method, but not for updateToken(). All the parameters are missing from the updateToken request, which also happens for the initial token request made by login() if I remove the defaultHeadersForTokenRequests: {'Content-Type': 'application/x-www-form-urlencoded'} line.
Here is my set up:
If you login and refresh the page, updpateToken() is called, but since it doesn't attach any parameters to the token request, authentication fails and the user gets logged out.
Am I missing something? Please let me know if more details are needed!
Thank you!
The text was updated successfully, but these errors were encountered: