Commit 4432d540 authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

New: Add Shibboleth Integration (coscine/issues#523)

parent e3ac1ae7
......@@ -56,6 +56,7 @@
<component
:is="currentInputCard"
:returnUrl="this.returnUrl"
:shibbolethReturnUrl="this.shibbolethReturnUrl"
@back="loginBack"
@clickGetLoginForm="getLoginForm"
@clickGetORCiDForm="getORCiDForm"
......@@ -140,6 +141,16 @@ function getReturnUrl() {
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() {
const hookupElement = document.getElementById('loginpage');
const orcidUrlString =
......@@ -171,6 +182,7 @@ export default Vue.extend({
rwthImage: rootUrl + rwthImagePath,
imageEnabled,
returnUrl: getReturnUrl(),
shibbolethReturnUrl: getShibbolethReturnUrl(),
orcidUrl: getORCiDUrl(),
currentInputCard: 'LoginMain',
};
......
......@@ -14,6 +14,12 @@
{{ $t('login_button_form') }}
</button>
</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">
<button class="btn btn-secondary w-100" disabled>{{ $t('login_button_without_account') }}</button>
</div>
......@@ -27,6 +33,7 @@ export default Vue.extend({
name: 'LoginMain',
props: {
returnUrl: String,
shibbolethReturnUrl: String,
},
methods: {
clickGetLoginForm() {
......
......@@ -10,6 +10,7 @@ export default {
login_button_with_account: 'Login-Zugang',
login_button_orcid: 'Anmelden mit ORCID ID',
login_button_form: 'Anmelden mit User ID',
login_shibboleth: 'Anmelden mit Shibboleth',
login_button_without_account: 'Weiter ohne Login',
signup: 'Anmelden',
back: 'Zurück',
......
......@@ -10,6 +10,7 @@ export default {
login_button_with_account: 'Login Access',
login_button_orcid: 'Sign in with ORCID ID',
login_button_form: 'Sign in with a User ID',
login_shibboleth: 'Sign in with Shibboleth',
login_button_without_account: 'Continue without Login',
signup: 'signup',
back: 'Back',
......
Markdown is supported
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