We have a regular cookie-based authorization web application, and now we want to separate the interface and backend (api) in order to have a third-party public API. Thus, our backend will be on one domain and on another interface.
For authorization, we would like to switch to OAuth 2 with JWT . In this case, our frontend application will have to use access_token instead of a cookie session, and this poses a big old question:
How to Stay Logged In - The infamous Remember Me checkbox (Part II of Website Based Authentication )
From an OAuth2 perspective, our external application will use something between the resource ownerโs Grid Credentials Credentials and the Implicit grant . This is closer to Credentials Credentials, because we are still going to use the usual registration form and will not redirect the user to another domain to log in. At the same time, it is closer to Implicit Grant, since all this will be only for the browser and JavaScript based on when the access_token is saved in the browser.
The RFC says the authorization server SHOULD NOT issue an update token if you use an implicit grant, and my question is that it is still valid in this when you really are not using 3-way OAuth, but your own api? Intuitively, I feel that having a refresh_token in a browser is a security hole, and I would like to confirm this with you guys, but that refresh_token seems to be the only way to work in login mode like cookies do.
UPD after comment by @FlorentMorselli:
OpenID specs still don't answer my question if I can only use refresh_token with a browser application
- Google says they provide
refresh_token only for access_type=offline - OpenID Connect Core says you cannot use update token with implicit stream
- OpenID Connect Core says nothing about using
refresh_token with Hybrid Flow - There's only one place that says something promising about
refresh_token with Hybrid Flow, but nothing for sure
UPD2 thanks @reallifelolcat
It seems that OpenID Connect does not explicitly support the Grant Credentials of the resource owner , which means that you need to redirect user > to the OpenID Connect server to log in. Do you know if there is another authentication method with user credentials through OAuth 2.0?
I believe that the separation of api and frontend is becoming more common these days, and I would appreciate if you share how you solve this problem with permanent access, and if you completely remove it and force the user to re-login every X weeks.
Thanks!