Kakao Login angular (typescript) with firebase

trying to create kakao login on my angular app with firebase.

  kakaoLogin() {
    window.Kakao.Auth.loginForm({
      success: (authObj: any) => {
        this.getKakao(authObj.access_token).then(res => { })
        this.afAuth.signInWithCustomToken(authObj.access_token).then(res => {
          console.log(res);

        })
      },
      fail(err: any) {
        console.log(err);
      },
    })
  }
  async getKakaoUser(token: string): Promise<User> {
    const kakaoUser: any = await this.http.get('https://kapi.kakao.com/v2/user/me?secure_resource=true', {
      headers: { Authorization: `Bearer ${token}` },
    });
    const user: any = {
      uid: `kakao:${kakaoUser.data.kakao_account.email}`,
      email: kakaoUser.data.kakao_account.email || "",
      displayName: kakaoUser.data.properties.nickname || "",
      photoURL: kakaoUser.data.properties.profile_image,
      provider: 'kakao',
    };
    return user;
  }

but it says Invalid assertion format. 3 dot separated segments required. (auth/invalid-custom-token).

as i’ve read some post on SO that authObj.access_token is not JWT token, so how can i convert it to JWT token?

UPDATE 1

I’m using v1 since when i tried using v2, like this

kakaoLogin() {
    window.Kakao.Auth.authorize({
      redirectUri: 'http://localhost:4200/auth/login',
    })
  }

it didn’t give me anything

Could not convert access_token to JWT token.

Turn on the open id connection setting and use the id token.

Concepts | Kakao Developers Concepts

i see, thank you. But just by activating the OpenID, when i tried to access the window.Kakao.Auth.loginForm still giving me kakao token not id token which is JWT?

the id_token in the response is the OIDC(JWT) value.

For more about the ID token, plead read OpenID Connect > ID Token. :slight_smile: