아래에 보면 access token을 받아오기 위해 꼭 지정해야하는 네가지가 있다.
response_type, client_id, redirect_uri, scope
여기서scope란 인증받은 사용자에게 구글에서 제공해주는 사용자의 정보 범위인데
나는 profile,email둘다를 가져와보고 싶었다.
배열등을 사용해봐도 안되었는데
해결책은 단지,
uri두개를 같은 작은따옴표 ' ' 에 띄어쓰기로 구분해서 한번에 적어주면 되던것이었다. 요렇게
'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email ',
화이팅
this.queryStr = stringify({
response_type: 'token',
client_id: CLIENT_ID,
redirect_uri: window.location.href,
scope:
'https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email ',
});
this.loginUrl = AUTHORIZE_URI + '?' + this.queryStr;
'Angular.js' 카테고리의 다른 글
Visual Studio Code 에서 Tab키가 정상작동 하지 않을경우 (1) | 2020.08.10 |
---|---|
Angular http 통신 등의 결과를 subscribe로 받아올때 에러가 return된다면? (0) | 2020.08.04 |
구글 OAuth2로그인 간단한 절차 (0) | 2020.07.30 |
구글 OAuth2 로그인 "확인되지 않은 앱 입니다. " 해결방법 !! [angular https ssl통신 설정방법 ] (0) | 2020.07.30 |
Toast UI Viewer 탑재하는법! (0) | 2020.07.24 |