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

Satellizer doesn't apply Authorization header if token has expired (via isAuthenticated)? #777

Open
roberttolton opened this issue Mar 25, 2016 · 3 comments

Comments

@roberttolton
Copy link

So, I'm trying to implement token refreshing based on this comment:
#58 (comment)

However, my API never gets the chance to reply with a 401 Unauthorized because Satellizer removes the Authorization header of a request that occurs after the expiration time of the token. So, because the Authorization header isn't set, my API replies with a 400 Bad Request because the token is MISSING, not because it has expired and needs refreshing.

Any ideas?

Would be it better to implement a timer in AngularJS set for shorter than my API's expiration time, or to refresh and set a new token on the client in every request?

Thanks!

@daniel-seitz
Copy link

Same here. The token should always be sent if present. Also when it is expired.

We need to check it on the backend anyway and return a corresponding status code. We could also implement functionality on the front end to show/do something when we have a expired token and despite this, I see no additional use for not sending the expired token.

Is there a use case?

@ketysek
Copy link

ketysek commented Aug 10, 2016

Ach ... I tried to solve token expiration via angular-http-auth-interceptor (whole afternoon), but it can't work, when server is responding with error 400 (token_not_provided) ... Why satellizer doesn't include token even if it's expired? I don't see the logic ... :(

@loginov-rocks
Copy link

loginov-rocks commented Sep 27, 2016

@ketysek #58 (comment)

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

4 participants