From a2181bae4b403187fa58bb920ba3b5cb33199c66 Mon Sep 17 00:00:00 2001 From: amontenegro Date: Wed, 8 Jan 2025 13:14:03 -0600 Subject: [PATCH] Login with auth.dev.orcid.org --- src/app/core/sign-in/sign-in.service.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app/core/sign-in/sign-in.service.ts b/src/app/core/sign-in/sign-in.service.ts index 81e7402b9e..7b731154d9 100644 --- a/src/app/core/sign-in/sign-in.service.ts +++ b/src/app/core/sign-in/sign-in.service.ts @@ -34,8 +34,10 @@ 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' } @@ -43,9 +45,9 @@ export class SignInService { 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) @@ -55,7 +57,11 @@ export class SignInService { } body = body.set('oauthRequest', signInLocal.isOauth ? 'true' : 'false') return this._http - .post(environment.API_WEB + loginUrl, body, { + .post(loginUrl, body, { + headers: new HttpHeaders({ + 'Access-Control-Allow-Origin': 'https://dev.orcid.org', + 'Content-Type': 'application/x-www-form-urlencoded' + }), withCredentials: true, }) .pipe(