Skip to content

Commit

Permalink
Login with auth.dev.orcid.org
Browse files Browse the repository at this point in the history
  • Loading branch information
amontenegro committed Jan 8, 2025
1 parent 3e212e5 commit a2181ba
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/app/core/sign-in/sign-in.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,20 @@ export class SignInService {
updateUserSession = true,
forceSessionUpdate = false
) {
let loginUrl = 'signin/auth.json'
let loginUrl = 'https://auth.dev.orcid.org/login'

/*
UNCOMMENT THIS!!!
if (signInLocal.type && signInLocal.type === TypeSignIn.institutional) {
loginUrl = 'shibboleth/signin/auth.json'
}
if (signInLocal.type && signInLocal.type === TypeSignIn.social) {
loginUrl = 'social/signin/auth.json'
}

*/
let body = new HttpParams({ encoder: new CustomEncoder() })
.set('userId', getOrcidNumber(signInLocal.data.username))
.set('username', getOrcidNumber(signInLocal.data.username))
.set('password', signInLocal.data.password)
if (signInLocal.data.verificationCode) {
body = body.set('verificationCode', signInLocal.data.verificationCode)
Expand All @@ -55,7 +57,11 @@ export class SignInService {
}
body = body.set('oauthRequest', signInLocal.isOauth ? 'true' : 'false')
return this._http
.post<SignIn>(environment.API_WEB + loginUrl, body, {
.post<SignIn>(loginUrl, body, {
headers: new HttpHeaders({
'Access-Control-Allow-Origin': 'https://dev.orcid.org',
'Content-Type': 'application/x-www-form-urlencoded'
}),
withCredentials: true,
})
.pipe(
Expand Down

0 comments on commit a2181ba

Please sign in to comment.