Class: RrxApi::Auth::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rrx_api/auth/base.rb

Overview

Abstract authentication provider base class. Subclass and override #id_from_token (and optionally #user_info) to implement a provider.

Direct Known Subclasses

Firebase

Instance Method Summary collapse

Instance Method Details

#id_from_token(_token) ⇒ String

Verify a bearer token and return the provider user ID.

Parameters:

  • _token (String)

Returns:

  • (String)

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/rrx_api/auth/base.rb', line 17

def id_from_token(_token)
  raise NotImplementedError, "#{self.class}#id_from_token is not implemented"
end

#user_info(_uid) ⇒ Object?

Fetch user info for a given provider UID (optional).

Parameters:

  • _uid (String)

Returns:

  • (Object, nil)


24
25
26
# File 'lib/rrx_api/auth/base.rb', line 24

def (_uid)
  nil
end