Skip to content

Commit 2a4423a

Browse files
committed
add login with custom token api
1 parent 651d75a commit 2a4423a

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

firebase-auth-rest/core/src/main/java/com/anotherdev/firebase/auth/rest/api/IdentityToolkitApi.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public interface IdentityToolkitApi {
3131
@POST("v1/accounts:signInWithIdp")
3232
Single<SignInResponse> signInWithCredential(@Body SignInWithIdpRequest request);
3333

34+
@POST("v1/accounts:signInWithCustomToken")
35+
Single<SignInResponse> signInWithCustomToken(@Body SignInRequest request);
36+
3437
@POST("v1/accounts:lookup")
3538
Single<JsonObject> getAccounts(@Body IdTokenRequest request);
3639

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.anotherdev.firebase.auth.rest.api.model;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
5+
import org.immutables.gson.Gson;
6+
import org.immutables.value.Value;
7+
8+
@Value.Immutable
9+
@Value.Style(strictBuilder = true)
10+
@Gson.TypeAdapters
11+
public interface SignInWithCustomTokenRequest extends SignInRequest {
12+
13+
@SerializedName("token")
14+
String getCustomToken();
15+
16+
17+
static ImmutableSignInWithCustomTokenRequest.Builder builder() {
18+
return ImmutableSignInWithCustomTokenRequest.builder();
19+
}
20+
}

0 commit comments

Comments
 (0)