loginWithKakaoAccount method
- List<
Prompt> ? prompts, - List<
String> ? channelPublicIds, - List<
String> ? serviceTerms, - String? loginHint,
- String? nonce,
KO: 카카오계정으로 로그인
prompts
에 상호작용 추가 요청 프롬프트 전달
channelPublicIds
에 카카오톡 채널 프로필 ID 전달
serviceTerms
서비스 약관 목록 전달
loginHint
에 카카오계정 로그인 페이지의 ID란에 자동 입력할 값 전달
ID 토큰 재생 공격 방지를 위한 검증 값, 임의의 문자열은 nonce
에 전달
EN: Login with Kakao Account
Pass the prompts to prompts
for requests to add interactions
Pass Kakao Talk Channel's profile IDs to channelPublicIds
Pass List of service terms to serviceTerms
Pass a value to fill in the ID field of the Kakao Account login page to loginHint
Pass a random string to prevent replay attacks to nonce
Implementation
Future<OAuthToken> loginWithKakaoAccount({
List<Prompt>? prompts,
List<String>? channelPublicIds,
List<String>? serviceTerms,
String? loginHint,
String? nonce,
}) async {
final codeVerifier = AuthCodeClient.codeVerifier();
final redirectUri = kIsWeb
? CommonConstants.webAccountLoginRedirectUri
: KakaoSdk.redirectUri;
final authCode = await AuthCodeClient.instance.authorize(
redirectUri: redirectUri,
prompts: prompts,
channelPublicIds: channelPublicIds,
serviceTerms: serviceTerms,
codeVerifier: codeVerifier,
loginHint: loginHint,
nonce: nonce,
webPopupLogin: true,
);
final token = await AuthApi.instance.issueAccessToken(
authCode: authCode,
codeVerifier: codeVerifier,
redirectUri: redirectUri,
);
await TokenManagerProvider.instance.manager.setToken(token);
return token;
}