How to get refresh_token with oauth?


#1

In my ionic app I’m using ngCordovaOauth to authenticate users with their gmail account. This works fine, but I now also want to obtain the refresh_token. However, as far as I now understand ngCordovaOauth uses the Implicit grant type of OAuth 2.0, which per the specification is meant for “clients implemented in a browser using a scripting language such as JavaScript”. With this flow the client is directly issued an Access Token, and only that. I think this means that I cannot use ngCordovaOauth to get the refresh_token (but please correct me if I’m wrong).

Does anybody know any way how I can get the refresh_token from the gmail api? All tips are welcome!


#2

Hi @kramer65,
I have been playing around with Auth0 and refresh_token works fine. There is only one problem…they are not cheap. So, I’d be interested to know if anyone has implemented an alternative free solution that offers refresh_token. This is a great reference blog post with sample project if you are interested… http://ionicframework.com/blog/authentication-in-ionic/


#3

Hi Miguellima, how do you rewrite the token on your local storage. I am using Laravel 5.1 to generate and refresh token but I cannot override the existing token. Any suggestions?