반응 앱에서 auth0으로 LinkedIn 인증을하고 있습니다. 콜백 URL에 localhost:3000/upload
을 설정하고 사용자가 localhost:3000/login
에 로그인 한 후 호핑하면 localhost:3000/upload
으로 리디렉션됩니다. 그러나, 나는 항상이 오류가 발생합니다 : url localhost:3000/login
은 콜백 URL 목록에 없습니다. 왜 auth0은 로그인 한 후 로그인 한 페이지로 돌아갈 것으로 예상합니까? 다른 URL로 가정하지 않는 이유는 무엇입니까? 그것은 나에게 의미가 없습니다.Auth0 콜백 URL 불일치
편집 :
이export default class AuthService {
constructor(clientId, domain) {
// Configure Auth0
const options = {
allowedConnections: ['linkedin'],
auth: {
params: {responseType: 'code'}
}
};
this.lock = new Auth0Lock(clientId, domain, options)
// Add callback for lock `authenticated` event
this.lock.on('authenticated', this._doAuthentication.bind(this))
// binds login functions to keep this context
this.login = this.login.bind(this)
this.loggedIn = this.loggedIn.bind(this)
}
_doAuthentication(authResult){
// Saves the user token
console.log(authResult);
this.setToken(authResult.idToken)
this.lock.getProfile(authResult.idToken, (error, profile) => {
if (error) {
console.log('Error loading the Profile', error)
} else {
console.log(profile)
}
})
}
//....
안녕하세요, 답변 해 주셔서 감사합니다. 나는 당신이 제안한 것을했지만, 여전히 내가 인증하는 동일한 URL로 안내합니다. –
반응 앱의 경우 Implicit Grant flow ...를 사용해야합니다. 따라서이 경우 응답 유형 = 토큰을 만들고 이벤트 권고를 사용하는 것이 좋습니다. 이해가 되니? – arcseldon
@shangsunset -이 문제를 해결 했습니까? – arcseldon