Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions h0 .dTag
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
private fun loginWithBrowser() {
// Setup the WebAuthProvider, using the custom scheme and scope.

WebAuthProvider.login(account)
.withScheme("demo")
.withScope("openid profile email")
// Launch the authentication passing the callback where the results will be received
.start(this, object : Callback<Credentials, AuthenticationException> {
// Called when there is an authentication failure
override fun onFailure(exception: AuthenticationException) {
// Something went wrong!
}

// Called when authentication completed successfully
override fun onSuccess(credentials: Credentials) {
// Get the access token from the credentials object.
// This can be used to call APIs
val accessToken = credentials.accessToken
}
})
}