| java.lang.Object | ||
| ↳ | com.google.firebase.auth.AbstractFirebaseAuth | |
| ↳ | com.google.firebase.auth.FirebaseAuth | |
This class is the entry point for all server-side Firebase Authentication actions.
You can get an instance of FirebaseAuth via getInstance(FirebaseApp) and
then use it to perform a variety of authentication-related operations, including generating
custom tokens for use by client-side code, verifying Firebase ID Tokens received from clients, or
creating new FirebaseApp instances that are scoped to a particular authentication UID.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String |
createSessionCookie(String idToken, SessionCookieOptions options)
Creates a new Firebase session cookie from the given ID token and options.
| ||||||||||
| ApiFuture<String> |
createSessionCookieAsync(String idToken, SessionCookieOptions options)
Similar to
createSessionCookie(String, SessionCookieOptions) but performs the
operation asynchronously. | ||||||||||
| synchronized static FirebaseAuth |
getInstance(FirebaseApp app)
Gets an instance of FirebaseAuth for a specific
FirebaseApp. | ||||||||||
| static FirebaseAuth |
getInstance()
Gets the FirebaseAuth instance for the default
FirebaseApp. | ||||||||||
| TenantManager | getTenantManager() | ||||||||||
| FirebaseToken |
verifySessionCookie(String cookie)
Parses and verifies a Firebase session cookie.
| ||||||||||
| FirebaseToken |
verifySessionCookie(String cookie, boolean checkRevoked)
Parses and verifies a Firebase session cookie.
| ||||||||||
| ApiFuture<FirebaseToken> |
verifySessionCookieAsync(String cookie)
Similar to
verifySessionCookie(String) but performs the operation asynchronously. | ||||||||||
| ApiFuture<FirebaseToken> |
verifySessionCookieAsync(String cookie, boolean checkRevoked)
Similar to
verifySessionCookie(String, boolean) but performs the operation
asynchronously. | ||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
doDestroy()
Performs any additional required clean up.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.firebase.auth.AbstractFirebaseAuth
| |||||||||||
From class
java.lang.Object
| |||||||||||
Creates a new Firebase session cookie from the given ID token and options. The returned JWT can be set as a server-side session cookie with a custom cookie policy.
| idToken | The Firebase ID token to exchange for a session cookie. |
|---|---|
| options | Additional options required to create the cookie. |
| IllegalArgumentException | If the ID token is null or empty, or if options is null. |
|---|---|
| FirebaseAuthException | If an error occurs while generating the session cookie. |
Similar to createSessionCookie(String, SessionCookieOptions) but performs the
operation asynchronously.
| idToken | The Firebase ID token to exchange for a session cookie. |
|---|---|
| options | Additional options required to create the cookie. |
ApiFuture which will complete successfully with a session cookie string. If
an error occurs while generating the cookie or if the specified ID token is invalid, the
future throws a FirebaseAuthException.| IllegalArgumentException | If the ID token is null or empty, or if options is null. |
|---|
Gets an instance of FirebaseAuth for a specific FirebaseApp.
| app | The FirebaseApp to get a FirebaseAuth instance for. |
|---|
Gets the FirebaseAuth instance for the default FirebaseApp.
FirebaseApp.
Parses and verifies a Firebase session cookie.
If verified successfully, returns a parsed version of the cookie from which the UID and the
other claims can be read. If the cookie is invalid, throws a FirebaseAuthException.
This method does not check whether the cookie has been revoked. See verifySessionCookie(String, boolean).
| cookie | A Firebase session cookie string to verify and parse. |
|---|
FirebaseToken representing the verified and decoded cookie.
| FirebaseAuthException |
|---|
Parses and verifies a Firebase session cookie.
If checkRevoked is true, additionally verifies that the cookie has not been revoked.
If verified successfully, returns a parsed version of the cookie from which the UID and the
other claims can be read. If the cookie is invalid or has been revoked while checkRevoked is true, throws a FirebaseAuthException.
| cookie | A Firebase session cookie string to verify and parse. |
|---|---|
| checkRevoked | A boolean indicating whether to check if the cookie was explicitly revoked. |
FirebaseToken representing the verified and decoded cookie.
| FirebaseAuthException |
|---|
Similar to verifySessionCookie(String) but performs the operation asynchronously.
| cookie | A Firebase session cookie string to verify and parse. |
|---|
ApiFuture which will complete successfully with the parsed cookie, or
unsuccessfully with the failure Exception.
Similar to verifySessionCookie(String, boolean) but performs the operation
asynchronously.
| cookie | A Firebase session cookie string to verify and parse. |
|---|---|
| checkRevoked | A boolean indicating whether to check if the cookie was explicitly revoked. |
ApiFuture which will complete successfully with the parsed cookie, or
unsuccessfully with the failure Exception.
Performs any additional required clean up.