How to use gatekeeper with android client?

I am creating an application consisting of a mobile client (native Android application) that will connect to my rail application. I need users to sign up and register in my rails app using the Android app. So I installed the gatekeeper and invented the gems in my rails app and followed the instructions here to see how everything works. As you can see on the authorization code stream page, there are several stages, such as client registration, authorization request, access token request.
My question is: how can I follow all these steps from my Android app. Any help is much appreciated. Thanks

+4
source share
1 answer

To register (register), you can create a method in a user controller that does just that. Or you can customize the Devise sign_up page to look better in mobile mode and do web-view registration in the app.

As for Doorkeeper, either follow the normal thread you linked to, or simplify it. What I did was

  • activate the update token - this will allow the user to get their access token and update token, the token used to regenerate the access token after its expiration. Thus, you do not save the user login registration in your application, but only tokens.

  • white label config/initializers/doorkeeper.rb, skip_authorization, . , :

    skip_authorization do |client|
      whitelisted_apps = ['app1_id', 'app2_id']
      whitelisted_apps.include? client.application.uid
    end
    

, .

+3

Source: https://habr.com/ru/post/1544636/


All Articles