Use firebase to manage authentications.
session
A valid Shiny session.
signed_in
Read the signed in user.
signed_up
Read the signed in user.
new()
Firebase$new( persistence = c("none", "session", "local"), config_path = "firebase.rds", 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
.
session
A valid shiny session.
Initialise firebase
print()
Firebase$print()
Print the class
sign_out()
Firebase$sign_out()
Signs out user
self
get_sign_out()
Firebase$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()
Firebase$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()
Firebase$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()
Firebase$is_signed_in()
Check whether use is signed in
A boolean indicating whether user has successfully signed in.
req_sign_in()
Firebase$req_sign_in()
Makes Shiny output, observer, or reactive require the user to be signed in
req_sign_out()
Firebase$req_sign_out()
Makes Shiny output, observer, or reactive require the user to be signed out
set_language_code()
Firebase$set_language_code(code)
code
iso639-1 language code.
Set language code for auth provider
self
delete_user()
Firebase$delete_user()
Delete the user
self
get_delete_user()
Firebase$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.
get_access_token()
Firebase$get_access_token()
Get user access token
User's access token
clear()
Firebase$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.
clone()
The objects of this class are cloneable with this method.
Firebase$clone(deep = FALSE)
deep
Whether to make a deep clone.