File tree 1 file changed +52
-0
lines changed
1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change 17
17
- [ Step 2: Input the code] ( #step-2-input-the-code )
18
18
- [ Sign Up with a database connection] ( #sign-up-with-a-database-connection )
19
19
- [ Get user information] ( #get-user-information )
20
+ - [ Custom Token Exchange] ( #custom-token-exchange )
20
21
- [ Credentials Manager] ( #credentials-manager )
21
22
- [ Secure Credentials Manager] ( #secure-credentials-manager )
22
23
- [ Usage] ( #usage )
@@ -487,6 +488,57 @@ authentication
487
488
```
488
489
</details >
489
490
491
+ ### Custom Token Exchange
492
+
493
+ ``` kotlin
494
+ authentication
495
+ .customTokenExchange(" subject_token_type" , " subject_token" )
496
+ .start(object : Callback <Credentials , AuthenticationException > {
497
+ override fun onSuccess (result : Credentials ) {
498
+ // Handle success
499
+ }
500
+
501
+ override fun onFailure (exception : AuthenticationException ) {
502
+ // Handle error
503
+ }
504
+
505
+ })
506
+ ```
507
+ <details >
508
+ <summary>Using coroutines</summary>
509
+
510
+ ``` kotlin
511
+ try {
512
+ val credentials = authentication
513
+ .tokenExchange(" subject_token_type" , " subject_token" )
514
+ .await()
515
+ } catch (e: AuthenticationException ) {
516
+ e.printStacktrace()
517
+ }
518
+ ```
519
+ </details >
520
+
521
+ <details >
522
+ <summary >Using Java</summary >
523
+
524
+ ``` java
525
+ authentication
526
+ .customTokenExchange(" subject_token_type" , " subject_token" )
527
+ .start(new Callback<Credentials , AuthenticationException > () {
528
+ @Override
529
+ public void onSuccess (@Nullable Credentials payload ) {
530
+ // Handle success
531
+ }
532
+ @Override
533
+ public void onFailure (@NonNull AuthenticationException error ) {
534
+ // Handle error
535
+ }
536
+ });
537
+ ```
538
+
539
+
540
+ </details >
541
+
490
542
491
543
## Credentials Manager
492
544
You can’t perform that action at this time.
0 commit comments