Commit 0a3364b9 authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

Merge branch 'Sprint/201922-2' into 'master'

New: Add Shibboleth Integration

See merge request coscine/app/login!13
parents e3ac1ae7 4432d540
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
<component <component
:is="currentInputCard" :is="currentInputCard"
:returnUrl="this.returnUrl" :returnUrl="this.returnUrl"
:shibbolethReturnUrl="this.shibbolethReturnUrl"
@back="loginBack" @back="loginBack"
@clickGetLoginForm="getLoginForm" @clickGetLoginForm="getLoginForm"
@clickGetORCiDForm="getORCiDForm" @clickGetORCiDForm="getORCiDForm"
...@@ -140,6 +141,16 @@ function getReturnUrl() { ...@@ -140,6 +141,16 @@ function getReturnUrl() {
return returnUrl; return returnUrl;
} }
function getShibbolethReturnUrl() {
const hookupElement = document.getElementById('loginpage');
const returnUrlParameters =
hookupElement != null ? hookupElement.getAttribute('returnUrl') : '';
const returnUrl = encodeURI(
'/coscine/api/Coscine.STS/Shibboleth/login?returnUrl=' + returnUrlParameters,
);
return returnUrl;
}
function getORCiDUrl() { function getORCiDUrl() {
const hookupElement = document.getElementById('loginpage'); const hookupElement = document.getElementById('loginpage');
const orcidUrlString = const orcidUrlString =
...@@ -171,6 +182,7 @@ export default Vue.extend({ ...@@ -171,6 +182,7 @@ export default Vue.extend({
rwthImage: rootUrl + rwthImagePath, rwthImage: rootUrl + rwthImagePath,
imageEnabled, imageEnabled,
returnUrl: getReturnUrl(), returnUrl: getReturnUrl(),
shibbolethReturnUrl: getShibbolethReturnUrl(),
orcidUrl: getORCiDUrl(), orcidUrl: getORCiDUrl(),
currentInputCard: 'LoginMain', currentInputCard: 'LoginMain',
}; };
......
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
{{ $t('login_button_form') }} {{ $t('login_button_form') }}
</button> </button>
</div> </div>
<form class="w-100" :action="shibbolethReturnUrl" method="post">
<div class="row">
<input class="btn btn-primary w-100" type="Submit" :value="$t('login_shibboleth')" />
<input type="hidden" name="wa" value="wsignin1.0" />
</div>
</form>
<div class="row"> <div class="row">
<button class="btn btn-secondary w-100" disabled>{{ $t('login_button_without_account') }}</button> <button class="btn btn-secondary w-100" disabled>{{ $t('login_button_without_account') }}</button>
</div> </div>
...@@ -27,6 +33,7 @@ export default Vue.extend({ ...@@ -27,6 +33,7 @@ export default Vue.extend({
name: 'LoginMain', name: 'LoginMain',
props: { props: {
returnUrl: String, returnUrl: String,
shibbolethReturnUrl: String,
}, },
methods: { methods: {
clickGetLoginForm() { clickGetLoginForm() {
......
...@@ -10,6 +10,7 @@ export default { ...@@ -10,6 +10,7 @@ export default {
login_button_with_account: 'Login-Zugang', login_button_with_account: 'Login-Zugang',
login_button_orcid: 'Anmelden mit ORCID ID', login_button_orcid: 'Anmelden mit ORCID ID',
login_button_form: 'Anmelden mit User ID', login_button_form: 'Anmelden mit User ID',
login_shibboleth: 'Anmelden mit Shibboleth',
login_button_without_account: 'Weiter ohne Login', login_button_without_account: 'Weiter ohne Login',
signup: 'Anmelden', signup: 'Anmelden',
back: 'Zurück', back: 'Zurück',
......
...@@ -10,6 +10,7 @@ export default { ...@@ -10,6 +10,7 @@ export default {
login_button_with_account: 'Login Access', login_button_with_account: 'Login Access',
login_button_orcid: 'Sign in with ORCID ID', login_button_orcid: 'Sign in with ORCID ID',
login_button_form: 'Sign in with a User ID', login_button_form: 'Sign in with a User ID',
login_shibboleth: 'Sign in with Shibboleth',
login_button_without_account: 'Continue without Login', login_button_without_account: 'Continue without Login',
signup: 'signup', signup: 'signup',
back: 'Back', back: 'Back',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment