File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
firebase-auth-rest/core/src/main/java/com/anotherdev/firebase/auth Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ public interface FirebaseAuth {
4545 @ CheckReturnValue
4646 Single <SignInResponse > signInWithCredential (@ NonNull IdpAuthCredential credential );
4747
48+ @ NonNull
49+ @ CheckReturnValue
50+ Single <SignInResponse > signInWithCustomToken (@ NonNull String customToken );
51+
4852 @ NonNull
4953 @ CheckReturnValue
5054 Single <SignInResponse > linkWithCredential (@ NonNull FirebaseUser user , @ NonNull IdpAuthCredential credential );
Original file line number Diff line number Diff line change 1515import com .anotherdev .firebase .auth .rest .api .model .ExchangeTokenRequest ;
1616import com .anotherdev .firebase .auth .rest .api .model .ImmutableSignInWithIdpRequest ;
1717import com .anotherdev .firebase .auth .rest .api .model .SignInAnonymouslyRequest ;
18+ import com .anotherdev .firebase .auth .rest .api .model .SignInWithCustomTokenRequest ;
1819import com .anotherdev .firebase .auth .rest .api .model .SignInWithEmailPasswordRequest ;
1920import com .anotherdev .firebase .auth .rest .api .model .SignInWithIdpRequest ;
2021import com .anotherdev .firebase .auth .util .IdTokenParser ;
@@ -124,6 +125,17 @@ public Single<SignInResponse> signInWithCredential(@NonNull IdpAuthCredential cr
124125 return performSignInWithCredential (builder , credential );
125126 }
126127
128+ @ NonNull
129+ @ Override
130+ public Single <SignInResponse > signInWithCustomToken (@ NonNull String customToken ) {
131+ SignInWithCustomTokenRequest request = SignInWithCustomTokenRequest .builder ()
132+ .customToken (customToken )
133+ .build ();
134+ return RestAuthApi .auth ()
135+ .signInWithCustomToken (request )
136+ .map (this ::saveCurrentUser );
137+ }
138+
127139 @ NonNull
128140 @ Override
129141 public Single <SignInResponse > linkWithCredential (@ NonNull FirebaseUser user , @ NonNull IdpAuthCredential credential ) {
You can’t perform that action at this time.
0 commit comments