FirebaseAuth: Firebase Authentication

FirebaseAuthR Documentation

Firebase Authentication

Description

Use firebase to manage authentications.

Value

An object of class FirebaseAuth.

Super class

firebase::Firebase -> FirebaseAuth

Active bindings

signed_in

Read the signed in user.

signed_up

Read the signed in user.

Methods

Public methods

Inherited methods

Method new()

Usage
FirebaseAuth$new(
  persistence = c("session", "local", "memory"),
  config_path = "firebase.rds",
  language_code = NULL,
  session = shiny::getDefaultReactiveDomain()
)
Arguments
persistence

How the auth should persit: none, the user has to sign in at every visit, session will only persist in current tab, local persist even when window is closed.

config_path

Path to the configuration file as created by firebase_config.

language_code

Sets the language to use for the UI. Supported languages are listed here. Set to browser to use the default browser language of the user.

session

A valid shiny session.

Details

Initialise firebase authentication


Method print()

Usage
FirebaseAuth$print()
Details

Print the class


Method sign_out()

Usage
FirebaseAuth$sign_out()
Details

Signs out user

Returns

self


Method get_sign_out()

Usage
FirebaseAuth$get_sign_out()
Details

Get signed out results

Returns

A list of length 2 containing success a boolean indicating wherther signing out was successful and response containing sucessful or the error.


Method get_signed_in()

Usage
FirebaseAuth$get_signed_in()
Details

Signed in user details triggered when auth states changes

Returns

A list of length 2 containing success a boolean indicating wherther signing in was successful and response containing the user object or NULL if signing in failed.


Method get_signed_up()

Usage
FirebaseAuth$get_signed_up()
Details

Get results of a sign up

Returns

A list of length 2 containing success a boolean indicating wherther signing in was successful and response containing the user object or NULL if signing in failed.


Method is_signed_in()

Usage
FirebaseAuth$is_signed_in()
Details

Check whether use is signed in

Returns

A boolean indicating whether user has successfully signed in.


Method req_sign_in()

Usage
FirebaseAuth$req_sign_in()
Details

Makes Shiny output, observer, or reactive require the user to be signed in


Method req_sign_out()

Usage
FirebaseAuth$req_sign_out()
Details

Makes Shiny output, observer, or reactive require the user to be signed out


Method set_language_code()

Usage
FirebaseAuth$set_language_code(code)
Arguments
code

iso639-1 language code.

Details

Set language code for auth provider

Returns

self


Method delete_user()

Usage
FirebaseAuth$delete_user()
Details

Delete the user

Returns

self


Method get_delete_user()

Usage
FirebaseAuth$get_delete_user()
Details

Get result of user deletion

Returns

A list of length 2 containing success a boolean indicating wherther deletion was successful and response containing either successful string or the error if signing in failed.


Method expose_auth()

Usage
FirebaseAuth$expose_auth()
Details

Expose Auth

Expose the firebaseAuth object the product of the authentication attaching it to the window: access it with window.firebaseAuth.


Method get_access_token()

Usage
FirebaseAuth$get_access_token()
Details

Get user access token

Returns

User's access token


Method clear()

Usage
FirebaseAuth$clear()
Details

Clear user session

This clears the login internally and will retrigger a JWT token check, only useful if you are running really long sessions.


Method request_id_token()

Usage
FirebaseAuth$request_id_token()
Details

Request the users' ID Token

Used to retrieved the user's ID token useful to connect with other Google APIs and make request on the user's behalf. This executes the request for the id token, this request can only be made once the user is signed in.

The actual id token is obtained with the get_id_token method.


Method get_id_token()

Usage
FirebaseAuth$get_id_token()
Details

Retrieve the users' ID Token

Also see request_id_token.

Returns

the id token (invisibly).


Method clone()

The objects of this class are cloneable with this method.

Usage
FirebaseAuth$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


firebase documentation built on July 9, 2023, 7:07 p.m.