Commit 327e60c3 authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

Merge branch 'Sprint/2021-01' into 'master'

Sprint/2021 01

See merge request !57
parents 5f6ee23c 3e884bef
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"@coscine/api-connection": "^1.24.2", "@coscine/api-connection": "^1.25.0",
"@coscine/component-library": "^1.5.0", "@coscine/component-library": "^1.5.0",
"@itcenter-layout/bootstrap": "^1.5.5", "@itcenter-layout/bootstrap": "^1.5.5",
"@itcenter-layout/masterpage": "^1.3.0", "@itcenter-layout/masterpage": "^1.3.0",
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
:is="(logoutState) ? logoutComponent : currentInputCard" :is="(logoutState) ? logoutComponent : currentInputCard"
:returnUrl="this.returnUrl" :returnUrl="this.returnUrl"
:shibbolethReturnUrl="this.shibbolethReturnUrl" :shibbolethReturnUrl="this.shibbolethReturnUrl"
:testShibbolethReturnUrl="this.testShibbolethReturnUrl"
:fhShibbolethReturnUrl="this.fhShibbolethReturnUrl"
:idpUrl="this.idpUrl" :idpUrl="this.idpUrl"
:loggedInWithShibboleth="this.loggedInWithShibboleth" :loggedInWithShibboleth="this.loggedInWithShibboleth"
:mergeReturnUrl="mergeReturnUrl" :mergeReturnUrl="mergeReturnUrl"
...@@ -125,11 +127,12 @@ function getReturnUrlParam() { ...@@ -125,11 +127,12 @@ function getReturnUrlParam() {
return returnUrlParameters; return returnUrlParameters;
} }
function getReturnUrl(method: string) { function getReturnUrl(method: string, entityId: string = '') {
const returnUrl = encodeURI( let returnUrl = '/coscine/api/Coscine.Api.STS/' + method + '/login?returnUrl=' + getReturnUrlParam();
'/coscine/api/Coscine.Api.STS/' + method + '/login?returnUrl=' + getReturnUrlParam(), if (entityId !== '') {
); returnUrl += '&entityId=' + entityId;
return returnUrl; }
return encodeURI(returnUrl);
} }
function getMergeReturnUrl() { function getMergeReturnUrl() {
...@@ -145,7 +148,7 @@ function getAccountReturnUrl() { ...@@ -145,7 +148,7 @@ function getAccountReturnUrl() {
} }
function getShibbolethReturnUrl() { function getShibbolethReturnUrl() {
return getReturnUrl('Shibboleth'); return getReturnUrl('Shibboleth', 'https://login-test.rz.rwth-aachen.de/shibboleth');
} }
function getIdpUrl() { function getIdpUrl() {
...@@ -204,7 +207,9 @@ export default Vue.extend({ ...@@ -204,7 +207,9 @@ export default Vue.extend({
rwthImage: rootUrl + rwthImagePath, rwthImage: rootUrl + rwthImagePath,
imageEnabled, imageEnabled,
returnUrl: getAccountReturnUrl(), returnUrl: getAccountReturnUrl(),
shibbolethReturnUrl: getShibbolethReturnUrl(), shibbolethReturnUrl: getReturnUrl('Shibboleth', 'https://login.rz.rwth-aachen.de/shibboleth'),
testShibbolethReturnUrl: getReturnUrl('Shibboleth', 'https://login-test.rz.rwth-aachen.de/shibboleth'),
fhShibbolethReturnUrl: getReturnUrl('Shibboleth', 'https://login.fh-aachen.de/idp/shibboleth'),
tosReturnUrl: getTOSReturnUrl(), tosReturnUrl: getTOSReturnUrl(),
mergeReturnUrl: getMergeReturnUrl(), mergeReturnUrl: getMergeReturnUrl(),
idpUrl: getIdpUrl(), idpUrl: getIdpUrl(),
......
...@@ -9,9 +9,15 @@ ...@@ -9,9 +9,15 @@
<span> {{ $t('login_button_orcid') }}</span> <span> {{ $t('login_button_orcid') }}</span>
</button> </button>
</div> </div>
<form class="w-100" :action="shibbolethReturnUrl" method="post"> <form class="w-100" :action="devMachine === true ? testShibbolethReturnUrl : shibbolethReturnUrl" method="post">
<div class="row"> <div class="row">
<input class="btn btn-primary w-100" type="Submit" :value="$t('login_shibboleth')" /> <input class="btn btn-primary w-100" type="Submit" :value="$t('login_rwth')" />
<input type="hidden" name="wa" value="wsignin1.0" />
</div>
</form>
<form class="w-100" :action="fhShibbolethReturnUrl" method="post">
<div class="row">
<input class="btn btn-primary w-100" type="Submit" :value="$t('login_fh')" />
<input type="hidden" name="wa" value="wsignin1.0" /> <input type="hidden" name="wa" value="wsignin1.0" />
</div> </div>
</form> </form>
...@@ -23,15 +29,23 @@ import Vue from 'vue'; ...@@ -23,15 +29,23 @@ import Vue from 'vue';
export default Vue.extend({ export default Vue.extend({
name: 'LoginMain', name: 'LoginMain',
data: {
devMachine: false,
},
props: { props: {
returnUrl: String, returnUrl: String,
shibbolethReturnUrl: String, shibbolethReturnUrl: String,
testShibbolethReturnUrl: String,
fhShibbolethReturnUrl: String,
}, },
methods: { methods: {
clickGetORCiDForm() { clickGetORCiDForm() {
this.$emit('clickGetORCiDForm'); this.$emit('clickGetORCiDForm');
}, },
}, },
created() {
this.devMachine = window.location.href.toString().indexOf('d-sp') !== -1;
}
}); });
</script> </script>
......
...@@ -10,7 +10,8 @@ export default { ...@@ -10,7 +10,8 @@ export default {
login_button_with_account: 'Login-Zugang', login_button_with_account: 'Login-Zugang',
login_button_orcid: 'Anmelden mit ORCID', login_button_orcid: 'Anmelden mit ORCID',
login_button_form: 'Anmelden mit User ID', login_button_form: 'Anmelden mit User ID',
login_shibboleth: 'Anmelden mit Shibboleth', login_rwth: 'Anmelden mit RWTH Aachen University',
login_fh: 'Anmelden mit University of Applied Sciences Aachen',
login_button_without_account: 'Weiter ohne Login', login_button_without_account: 'Weiter ohne Login',
logout_button_orcid: 'Logout von ORCID', logout_button_orcid: 'Logout von ORCID',
logout_shibboleth: 'Logout von Shibboleth', logout_shibboleth: 'Logout von Shibboleth',
......
...@@ -10,7 +10,8 @@ export default { ...@@ -10,7 +10,8 @@ export default {
login_button_with_account: 'Login Access', login_button_with_account: 'Login Access',
login_button_orcid: 'Sign in with ORCID', login_button_orcid: 'Sign in with ORCID',
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_rwth: 'Sign in with RWTH Aachen University',
login_fh: 'Sign in with University of Applied Sciences Aachen',
login_button_without_account: 'Continue without Login', login_button_without_account: 'Continue without Login',
logout_button_orcid: 'Logout from ORCID', logout_button_orcid: 'Logout from ORCID',
logout_shibboleth: 'Logout from Shibboleth', logout_shibboleth: 'Logout from Shibboleth',
......
This diff is collapsed.
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