Skip to content

Commit

Permalink
리디렉스 uri 수정 및 state 기존 함수 활용
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnkim committed Sep 4, 2024
1 parent 1221007 commit fc9d7dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/services/socialauth/SocialAuthService.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ class SocialAuthService {
///Naver Sign In
Future<void> signInWithNaver() async {
final String clientId = 'Q_XaNrrZRENiDAmzchib'; //TODO: 값 다른 곳에 저장
final String redirectUri = 'https://us-central1-blueberrytemplate-2024-summer.cloudfunctions.net/naverLoginCallback'; //TODO: 값 다른 곳에 저장
final String state = base64Url.encode(List<int>.generate(16, (_) => Random().nextInt(255))); // 사이트 간 요청 위조 공격을 방지하기 위한 상태 토큰
final Uri url = Uri.parse('https://nid.naver.com/oauth2.0/authorize?response_type=code&client_id=$clientId&redirect_uri=$redirectUri&state=$state');
final String redirectUri =
'https://us-central1-blueberrytemplate-2024-summer.cloudfunctions.net/naverLogin'; //TODO: 값 다른 곳에 저장
final String state = generateNonce();
final Uri url = Uri.parse(
'https://nid.naver.com/oauth2.0/authorize?response_type=code&client_id=$clientId&redirect_uri=$redirectUri&state=$state');
await launchUrl(url);
}

Expand Down

0 comments on commit fc9d7dd

Please sign in to comment.