authorizeWithTalk method
- String? clientId,
- required String redirectUri,
- List<
Prompt> ? prompts, - List<
String> ? channelPublicId, - List<
String> ? serviceTerms, - String? codeVerifier,
- String? nonce,
- String? kauthTxId,
- String? stateToken,
- bool webPopupLogin = false,
KO: 카카오톡으로 로그인: 리다이렉트 방식
EN: Login with Kakao Talk through redirection
Implementation
Future<String> authorizeWithTalk({
String? clientId,
required String redirectUri,
List<Prompt>? prompts,
List<String>? channelPublicId,
List<String>? serviceTerms,
String? codeVerifier,
String? nonce,
String? kauthTxId,
String? stateToken,
bool webPopupLogin = false,
}) async {
try {
final webStateToken =
stateToken ?? (kIsWeb ? generateRandomString(20) : null);
var response = await _openKakaoTalk(
clientId ?? KakaoSdk.appKey,
redirectUri,
channelPublicId,
serviceTerms,
codeVerifier,
prompts,
nonce,
kauthTxId,
stateToken: webStateToken,
webPopupLogin: webPopupLogin,
);
if (kIsWeb) {
if (webPopupLogin) {
return response;
}
var params = {
'redirect_uri': redirectUri,
'code': response,
'state': webStateToken
};
await _channel.invokeMethod('redirectForEasyLogin', params);
return response;
}
return _parseCode(response);
} catch (e) {
SdkLog.e(e);
rethrow;
}
}