FirebaseAuth | R Documentation |
Use firebase to manage authentications.
An object of class FirebaseAuth
.
firebase::Firebase
-> FirebaseAuth
signed_in
Read the signed in user.
signed_up
Read the signed in user.
new()
FirebaseAuth$new( persistence = c("session", "local", "memory"), config_path = "firebase.rds", language_code = NULL, session = shiny::getDefaultReactiveDomain() )
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.
Initialise firebase authentication
print()
FirebaseAuth$print()
Print the class
sign_out()
FirebaseAuth$sign_out()
Signs out user
self
get_sign_out()
FirebaseAuth$get_sign_out()
Get signed out results
A list of length 2 containing success
a boolean
indicating wherther signing out was successful and response
containing sucessful
or the error.
get_signed_in()
FirebaseAuth$get_signed_in()
Signed in user details triggered when auth states changes
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.
get_signed_up()
FirebaseAuth$get_signed_up()
Get results of a sign up
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.
is_signed_in()
FirebaseAuth$is_signed_in()
Check whether use is signed in
A boolean indicating whether user has successfully signed in.
req_sign_in()
FirebaseAuth$req_sign_in()
Makes Shiny output, observer, or reactive require the user to be signed in
req_sign_out()
FirebaseAuth$req_sign_out()
Makes Shiny output, observer, or reactive require the user to be signed out
set_language_code()
FirebaseAuth$set_language_code(code)
code
iso639-1 language code.
Set language code for auth provider
self
delete_user()
FirebaseAuth$delete_user()
Delete the user
self
get_delete_user()
FirebaseAuth$get_delete_user()
Get result of user deletion
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.
expose_auth()
FirebaseAuth$expose_auth()
Expose Auth
Expose the firebaseAuth
object the product of the authentication
attaching it to the window
: access it with window.firebaseAuth
.
get_access_token()
FirebaseAuth$get_access_token()
Get user access token
User's access token
clear()
FirebaseAuth$clear()
Clear user session
This clears the login internally and will retrigger a JWT token check, only useful if you are running really long sessions.
request_id_token()
FirebaseAuth$request_id_token()
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.
get_id_token()
FirebaseAuth$get_id_token()
Retrieve the users' ID Token
Also see request_id_token
.
the id token (invisibly).
clone()
The objects of this class are cloneable with this method.
FirebaseAuth$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.