Class: FirebaseTokenAuth::AdminClient
- Inherits:
-
Object
- Object
- FirebaseTokenAuth::AdminClient
- Defined in:
- lib/firebase_token_auth/admin_client.rb
Instance Attribute Summary collapse
-
#service ⇒ Object
Returns the value of attribute service.
Instance Method Summary collapse
- #get_account_info(params) ⇒ Object
-
#initialize(configuration) ⇒ AdminClient
constructor
A new instance of AdminClient.
- #update_existing_account(uid, attributes) ⇒ Object
- #verify_custom_token(custom_token) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ AdminClient
Returns a new instance of AdminClient.
7 8 9 10 |
# File 'lib/firebase_token_auth/admin_client.rb', line 7 def initialize(configuration) @service = Google::Apis::IdentitytoolkitV3::IdentityToolkitService.new @service. = configuration.auth end |
Instance Attribute Details
#service ⇒ Object
Returns the value of attribute service.
5 6 7 |
# File 'lib/firebase_token_auth/admin_client.rb', line 5 def service @service end |
Instance Method Details
#get_account_info(params) ⇒ Object
12 13 14 15 |
# File 'lib/firebase_token_auth/admin_client.rb', line 12 def get_account_info(params) request = Google::Apis::IdentitytoolkitV3::GetAccountInfoRequest.new(**params) service.get_account_info(request) end |
#update_existing_account(uid, attributes) ⇒ Object
17 18 19 20 21 |
# File 'lib/firebase_token_auth/admin_client.rb', line 17 def update_existing_account(uid, attributes) update_params = { local_id: uid }.merge!(permit_attributes(attributes)) request = Google::Apis::IdentitytoolkitV3::SetAccountInfoRequest.new(**update_params) service.set_account_info(request) end |
#verify_custom_token(custom_token) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/firebase_token_auth/admin_client.rb', line 23 def verify_custom_token(custom_token) request = Google::Apis::IdentitytoolkitV3::VerifyCustomTokenRequest.new( token: custom_token, return_secure_token: true ) service.verify_custom_token(request) end |