Skip to content
Snippets Groups Projects
Verified Commit b2e610ad authored by Martin Weise's avatar Martin Weise
Browse files

Fixed the signup

parent 82470fac
No related branches found
No related tags found
1 merge request!374Bumped version of DBRepo
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"oauth2DevicePollingInterval" : 5, "oauth2DevicePollingInterval" : 5,
"enabled" : true, "enabled" : true,
"sslRequired" : "none", "sslRequired" : "none",
"registrationAllowed" : false, "registrationAllowed" : true,
"registrationEmailAsUsername" : false, "registrationEmailAsUsername" : false,
"rememberMe" : false, "rememberMe" : false,
"verifyEmail" : true, "verifyEmail" : true,
...@@ -2132,11 +2132,15 @@ ...@@ -2132,11 +2132,15 @@
"protocolMapper" : "oidc-usermodel-realm-role-mapper", "protocolMapper" : "oidc-usermodel-realm-role-mapper",
"consentRequired" : false, "consentRequired" : false,
"config" : { "config" : {
"introspection.token.claim" : "true",
"userinfo.token.claim" : "false",
"multivalued" : "true",
"user.attribute" : "foo", "user.attribute" : "foo",
"id.token.claim" : "true",
"lightweight.claim" : "false",
"access.token.claim" : "true", "access.token.claim" : "true",
"claim.name" : "realm_access.roles", "claim.name" : "realm_access.roles",
"jsonType.label" : "String", "jsonType.label" : "String"
"multivalued" : "true"
} }
}, { }, {
"id" : "a7bd6723-e58e-47f7-95c0-2925ce99283d", "id" : "a7bd6723-e58e-47f7-95c0-2925ce99283d",
...@@ -2166,6 +2170,10 @@ ...@@ -2166,6 +2170,10 @@
"strictTransportSecurity" : "max-age=31536000; includeSubDomains" "strictTransportSecurity" : "max-age=31536000; includeSubDomains"
}, },
"smtpServer" : { }, "smtpServer" : { },
"loginTheme" : "keycloak",
"accountTheme" : "",
"adminTheme" : "",
"emailTheme" : "",
"eventsEnabled" : false, "eventsEnabled" : false,
"eventsListeners" : [ "jboss-logging" ], "eventsListeners" : [ "jboss-logging" ],
"enabledEventTypes" : [ "SEND_RESET_PASSWORD", "UPDATE_CONSENT_ERROR", "GRANT_CONSENT", "VERIFY_PROFILE_ERROR", "REMOVE_TOTP", "REVOKE_GRANT", "UPDATE_TOTP", "LOGIN_ERROR", "CLIENT_LOGIN", "RESET_PASSWORD_ERROR", "IMPERSONATE_ERROR", "CODE_TO_TOKEN_ERROR", "CUSTOM_REQUIRED_ACTION", "OAUTH2_DEVICE_CODE_TO_TOKEN_ERROR", "RESTART_AUTHENTICATION", "IMPERSONATE", "UPDATE_PROFILE_ERROR", "LOGIN", "OAUTH2_DEVICE_VERIFY_USER_CODE", "UPDATE_PASSWORD_ERROR", "CLIENT_INITIATED_ACCOUNT_LINKING", "TOKEN_EXCHANGE", "AUTHREQID_TO_TOKEN", "LOGOUT", "REGISTER", "DELETE_ACCOUNT_ERROR", "CLIENT_REGISTER", "IDENTITY_PROVIDER_LINK_ACCOUNT", "DELETE_ACCOUNT", "UPDATE_PASSWORD", "CLIENT_DELETE", "FEDERATED_IDENTITY_LINK_ERROR", "IDENTITY_PROVIDER_FIRST_LOGIN", "CLIENT_DELETE_ERROR", "VERIFY_EMAIL", "CLIENT_LOGIN_ERROR", "RESTART_AUTHENTICATION_ERROR", "EXECUTE_ACTIONS", "REMOVE_FEDERATED_IDENTITY_ERROR", "TOKEN_EXCHANGE_ERROR", "PERMISSION_TOKEN", "SEND_IDENTITY_PROVIDER_LINK_ERROR", "EXECUTE_ACTION_TOKEN_ERROR", "SEND_VERIFY_EMAIL", "OAUTH2_DEVICE_AUTH", "EXECUTE_ACTIONS_ERROR", "REMOVE_FEDERATED_IDENTITY", "OAUTH2_DEVICE_CODE_TO_TOKEN", "IDENTITY_PROVIDER_POST_LOGIN", "IDENTITY_PROVIDER_LINK_ACCOUNT_ERROR", "OAUTH2_DEVICE_VERIFY_USER_CODE_ERROR", "UPDATE_EMAIL", "REGISTER_ERROR", "REVOKE_GRANT_ERROR", "EXECUTE_ACTION_TOKEN", "LOGOUT_ERROR", "UPDATE_EMAIL_ERROR", "CLIENT_UPDATE_ERROR", "AUTHREQID_TO_TOKEN_ERROR", "UPDATE_PROFILE", "CLIENT_REGISTER_ERROR", "FEDERATED_IDENTITY_LINK", "SEND_IDENTITY_PROVIDER_LINK", "SEND_VERIFY_EMAIL_ERROR", "RESET_PASSWORD", "CLIENT_INITIATED_ACCOUNT_LINKING_ERROR", "OAUTH2_DEVICE_AUTH_ERROR", "UPDATE_CONSENT", "REMOVE_TOTP_ERROR", "VERIFY_EMAIL_ERROR", "SEND_RESET_PASSWORD_ERROR", "CLIENT_UPDATE", "CUSTOM_REQUIRED_ACTION_ERROR", "IDENTITY_PROVIDER_POST_LOGIN_ERROR", "UPDATE_TOTP_ERROR", "CODE_TO_TOKEN", "VERIFY_PROFILE", "GRANT_CONSENT_ERROR", "IDENTITY_PROVIDER_FIRST_LOGIN_ERROR" ], "enabledEventTypes" : [ "SEND_RESET_PASSWORD", "UPDATE_CONSENT_ERROR", "GRANT_CONSENT", "VERIFY_PROFILE_ERROR", "REMOVE_TOTP", "REVOKE_GRANT", "UPDATE_TOTP", "LOGIN_ERROR", "CLIENT_LOGIN", "RESET_PASSWORD_ERROR", "IMPERSONATE_ERROR", "CODE_TO_TOKEN_ERROR", "CUSTOM_REQUIRED_ACTION", "OAUTH2_DEVICE_CODE_TO_TOKEN_ERROR", "RESTART_AUTHENTICATION", "IMPERSONATE", "UPDATE_PROFILE_ERROR", "LOGIN", "OAUTH2_DEVICE_VERIFY_USER_CODE", "UPDATE_PASSWORD_ERROR", "CLIENT_INITIATED_ACCOUNT_LINKING", "TOKEN_EXCHANGE", "AUTHREQID_TO_TOKEN", "LOGOUT", "REGISTER", "DELETE_ACCOUNT_ERROR", "CLIENT_REGISTER", "IDENTITY_PROVIDER_LINK_ACCOUNT", "DELETE_ACCOUNT", "UPDATE_PASSWORD", "CLIENT_DELETE", "FEDERATED_IDENTITY_LINK_ERROR", "IDENTITY_PROVIDER_FIRST_LOGIN", "CLIENT_DELETE_ERROR", "VERIFY_EMAIL", "CLIENT_LOGIN_ERROR", "RESTART_AUTHENTICATION_ERROR", "EXECUTE_ACTIONS", "REMOVE_FEDERATED_IDENTITY_ERROR", "TOKEN_EXCHANGE_ERROR", "PERMISSION_TOKEN", "SEND_IDENTITY_PROVIDER_LINK_ERROR", "EXECUTE_ACTION_TOKEN_ERROR", "SEND_VERIFY_EMAIL", "OAUTH2_DEVICE_AUTH", "EXECUTE_ACTIONS_ERROR", "REMOVE_FEDERATED_IDENTITY", "OAUTH2_DEVICE_CODE_TO_TOKEN", "IDENTITY_PROVIDER_POST_LOGIN", "IDENTITY_PROVIDER_LINK_ACCOUNT_ERROR", "OAUTH2_DEVICE_VERIFY_USER_CODE_ERROR", "UPDATE_EMAIL", "REGISTER_ERROR", "REVOKE_GRANT_ERROR", "EXECUTE_ACTION_TOKEN", "LOGOUT_ERROR", "UPDATE_EMAIL_ERROR", "CLIENT_UPDATE_ERROR", "AUTHREQID_TO_TOKEN_ERROR", "UPDATE_PROFILE", "CLIENT_REGISTER_ERROR", "FEDERATED_IDENTITY_LINK", "SEND_IDENTITY_PROVIDER_LINK", "SEND_VERIFY_EMAIL_ERROR", "RESET_PASSWORD", "CLIENT_INITIATED_ACCOUNT_LINKING_ERROR", "OAUTH2_DEVICE_AUTH_ERROR", "UPDATE_CONSENT", "REMOVE_TOTP_ERROR", "VERIFY_EMAIL_ERROR", "SEND_RESET_PASSWORD_ERROR", "CLIENT_UPDATE", "CUSTOM_REQUIRED_ACTION_ERROR", "IDENTITY_PROVIDER_POST_LOGIN_ERROR", "UPDATE_TOTP_ERROR", "CODE_TO_TOKEN", "VERIFY_PROFILE", "GRANT_CONSENT_ERROR", "IDENTITY_PROVIDER_FIRST_LOGIN_ERROR" ],
...@@ -2215,7 +2223,7 @@ ...@@ -2215,7 +2223,7 @@
"subType" : "anonymous", "subType" : "anonymous",
"subComponents" : { }, "subComponents" : { },
"config" : { "config" : {
"allowed-protocol-mapper-types" : [ "oidc-address-mapper", "oidc-usermodel-attribute-mapper", "saml-user-property-mapper", "oidc-sha256-pairwise-sub-mapper", "oidc-usermodel-property-mapper", "saml-user-attribute-mapper", "oidc-full-name-mapper", "saml-role-list-mapper" ] "allowed-protocol-mapper-types" : [ "oidc-address-mapper", "saml-user-attribute-mapper", "oidc-full-name-mapper", "oidc-usermodel-attribute-mapper", "oidc-sha256-pairwise-sub-mapper", "oidc-usermodel-property-mapper", "saml-user-property-mapper", "saml-role-list-mapper" ]
} }
}, { }, {
"id" : "1849e52a-b8c9-44a8-af3d-ee19376a1ed1", "id" : "1849e52a-b8c9-44a8-af3d-ee19376a1ed1",
...@@ -2241,7 +2249,7 @@ ...@@ -2241,7 +2249,7 @@
"subType" : "authenticated", "subType" : "authenticated",
"subComponents" : { }, "subComponents" : { },
"config" : { "config" : {
"allowed-protocol-mapper-types" : [ "oidc-full-name-mapper", "oidc-address-mapper", "saml-user-property-mapper", "saml-user-attribute-mapper", "saml-role-list-mapper", "oidc-usermodel-property-mapper", "oidc-usermodel-attribute-mapper", "oidc-sha256-pairwise-sub-mapper" ] "allowed-protocol-mapper-types" : [ "oidc-address-mapper", "saml-role-list-mapper", "oidc-full-name-mapper", "oidc-usermodel-attribute-mapper", "oidc-sha256-pairwise-sub-mapper", "saml-user-attribute-mapper", "saml-user-property-mapper", "oidc-usermodel-property-mapper" ]
} }
} ], } ],
"org.keycloak.storage.UserStorageProvider" : [ { "org.keycloak.storage.UserStorageProvider" : [ {
...@@ -2257,8 +2265,8 @@ ...@@ -2257,8 +2265,8 @@
"config" : { "config" : {
"ldap.attribute" : [ "createTimestamp" ], "ldap.attribute" : [ "createTimestamp" ],
"is.mandatory.in.ldap" : [ "false" ], "is.mandatory.in.ldap" : [ "false" ],
"read.only" : [ "true" ],
"always.read.value.from.ldap" : [ "true" ], "always.read.value.from.ldap" : [ "true" ],
"read.only" : [ "true" ],
"user.model.attribute" : [ "createTimestamp" ] "user.model.attribute" : [ "createTimestamp" ]
} }
}, { }, {
...@@ -2269,8 +2277,8 @@ ...@@ -2269,8 +2277,8 @@
"config" : { "config" : {
"ldap.attribute" : [ "sn" ], "ldap.attribute" : [ "sn" ],
"is.mandatory.in.ldap" : [ "true" ], "is.mandatory.in.ldap" : [ "true" ],
"always.read.value.from.ldap" : [ "true" ],
"read.only" : [ "false" ], "read.only" : [ "false" ],
"always.read.value.from.ldap" : [ "true" ],
"user.model.attribute" : [ "lastName" ] "user.model.attribute" : [ "lastName" ]
} }
}, { }, {
...@@ -2305,13 +2313,13 @@ ...@@ -2305,13 +2313,13 @@
"config" : { "config" : {
"membership.attribute.type" : [ "DN" ], "membership.attribute.type" : [ "DN" ],
"group.name.ldap.attribute" : [ "cn" ], "group.name.ldap.attribute" : [ "cn" ],
"preserve.group.inheritance" : [ "false" ],
"membership.user.ldap.attribute" : [ "uid" ], "membership.user.ldap.attribute" : [ "uid" ],
"preserve.group.inheritance" : [ "false" ],
"groups.dn" : [ "ou=users,dc=dbrepo,dc=at" ], "groups.dn" : [ "ou=users,dc=dbrepo,dc=at" ],
"mode" : [ "LDAP_ONLY" ], "mode" : [ "LDAP_ONLY" ],
"user.roles.retrieve.strategy" : [ "LOAD_GROUPS_BY_MEMBER_ATTRIBUTE" ], "user.roles.retrieve.strategy" : [ "LOAD_GROUPS_BY_MEMBER_ATTRIBUTE" ],
"membership.ldap.attribute" : [ "member" ],
"ignore.missing.groups" : [ "false" ], "ignore.missing.groups" : [ "false" ],
"membership.ldap.attribute" : [ "member" ],
"memberof.ldap.attribute" : [ "memberOf" ], "memberof.ldap.attribute" : [ "memberOf" ],
"group.object.classes" : [ "groupOfNames" ], "group.object.classes" : [ "groupOfNames" ],
"drop.non.existing.groups.during.sync" : [ "false" ], "drop.non.existing.groups.during.sync" : [ "false" ],
...@@ -2336,18 +2344,18 @@ ...@@ -2336,18 +2344,18 @@
"subComponents" : { }, "subComponents" : { },
"config" : { "config" : {
"ldap.attribute" : [ "uid" ], "ldap.attribute" : [ "uid" ],
"is.mandatory.in.ldap" : [ "true" ],
"attribute.force.default" : [ "false" ], "attribute.force.default" : [ "false" ],
"is.mandatory.in.ldap" : [ "true" ],
"is.binary.attribute" : [ "false" ], "is.binary.attribute" : [ "false" ],
"read.only" : [ "false" ],
"always.read.value.from.ldap" : [ "false" ], "always.read.value.from.ldap" : [ "false" ],
"read.only" : [ "false" ],
"user.model.attribute" : [ "username" ] "user.model.attribute" : [ "username" ]
} }
} ] } ]
}, },
"config" : { "config" : {
"pagination" : [ "false" ],
"fullSyncPeriod" : [ "-1" ], "fullSyncPeriod" : [ "-1" ],
"pagination" : [ "false" ],
"startTls" : [ "false" ], "startTls" : [ "false" ],
"connectionPooling" : [ "true" ], "connectionPooling" : [ "true" ],
"usersDn" : [ "ou=users,dc=dbrepo,dc=at" ], "usersDn" : [ "ou=users,dc=dbrepo,dc=at" ],
...@@ -2356,14 +2364,14 @@ ...@@ -2356,14 +2364,14 @@
"importEnabled" : [ "true" ], "importEnabled" : [ "true" ],
"enabled" : [ "true" ], "enabled" : [ "true" ],
"changedSyncPeriod" : [ "-1" ], "changedSyncPeriod" : [ "-1" ],
"bindCredential" : [ "admin" ],
"bindDn" : [ "cn=admin,dc=dbrepo,dc=at" ], "bindDn" : [ "cn=admin,dc=dbrepo,dc=at" ],
"usernameLDAPAttribute" : [ "uid" ], "usernameLDAPAttribute" : [ "uid" ],
"bindCredential" : [ "admin" ],
"lastSync" : [ "1719252666" ], "lastSync" : [ "1719252666" ],
"vendor" : [ "other" ], "vendor" : [ "other" ],
"uuidLDAPAttribute" : [ "entryUUID" ], "uuidLDAPAttribute" : [ "entryUUID" ],
"connectionUrl" : [ "ldap://identity-service:1389" ],
"allowKerberosAuthentication" : [ "false" ], "allowKerberosAuthentication" : [ "false" ],
"connectionUrl" : [ "ldap://identity-service:1389" ],
"syncRegistrations" : [ "true" ], "syncRegistrations" : [ "true" ],
"authType" : [ "simple" ], "authType" : [ "simple" ],
"useTruststoreSpi" : [ "always" ], "useTruststoreSpi" : [ "always" ],
......
...@@ -104,14 +104,6 @@ ...@@ -104,14 +104,6 @@
@click="login()"> @click="login()">
{{ $t('navigation.login') }} {{ $t('navigation.login') }}
</v-btn> </v-btn>
<v-btn
v-if="!loggedIn"
color="primary"
variant="flat"
:prepend-icon="$vuetify.display.mdAndUp ? 'mdi-account-plus' : null"
to="/signup">
{{ $t('navigation.signup') }}
</v-btn>
<v-btn <v-btn
v-if="loggedIn" v-if="loggedIn"
to="/user" to="/user"
...@@ -288,7 +280,7 @@ export default { ...@@ -288,7 +280,7 @@ export default {
searchVariant () { searchVariant () {
const runtimeConfig = useRuntimeConfig() const runtimeConfig = useRuntimeConfig()
return this.$vuetify.theme.global.name.toLowerCase().endsWith('contrast') ? runtimeConfig.public.variant.input.contrast : 'solo-filled' return this.$vuetify.theme.global.name.toLowerCase().endsWith('contrast') ? runtimeConfig.public.variant.input.contrast : 'solo-filled'
}, }
}, },
watch: { watch: {
'$route.params': { '$route.params': {
......
...@@ -3,19 +3,19 @@ import vuetify from 'vite-plugin-vuetify' ...@@ -3,19 +3,19 @@ import vuetify from 'vite-plugin-vuetify'
const proxy: any = {} const proxy: any = {}
// /* proxies the backend calls, >>NOT<< the frontend calls (clicking) */ /* proxies the backend calls, >>NOT<< the frontend calls (clicking) */
// if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// const api = 'http://localhost' const api = 'http://localhost'
// proxy['/api'] = api proxy['/api'] = api
// proxy['/pid'] = { proxy['/pid'] = {
// target: api + '/api', target: api + '/api',
// changeOrigin: true, changeOrigin: true,
// pathRewrite: { pathRewrite: {
// '^/pid': '/pid' '^/pid': '/pid'
// } }
// } }
// process.env.NUXT_PUBLIC_API_SERVER = api process.env.NUXT_PUBLIC_API_SERVER = api
// } }
/** /**
* https://nuxt.com/docs/guide/concepts/rendering#hybrid-rendering * https://nuxt.com/docs/guide/concepts/rendering#hybrid-rendering
......
<template>
<div
v-if="!loggedIn">
<v-toolbar
:title="$t('pages.signup.name')"
flat />
<v-form
ref="form"
v-model="valid"
@submit.prevent="submit">
<v-card
variant="flat"
rounded="0">
<v-card-text>
<v-row dense>
<v-col sm="6">
<v-text-field
v-model="createAccount.email"
type="email"
autocomplete="off"
autofocus
required
name="email"
:rules="[v => !!v || $t('validation.required')]"
:hint="$t('pages.signup.email.hint')"
:label="$t('pages.signup.email.label')" />
</v-col>
</v-row>
<v-row dense>
<v-col sm="6">
<v-text-field
v-model="createAccount.username"
autocomplete="off"
required
name="username"
:rules="[v => !!v || $t('validation.required'),
v => /^[a-z0-9]{3,}$/.test(v) || $t('validation.user.pattern'),
v => !usernames.includes(v) || $t('validation.user.exists')]"
persistent-hint
:hint="$t('pages.signup.username.hint')"
:label="$t('pages.signup.username.label')" />
</v-col>
</v-row>
<v-row dense>
<v-col sm="6">
<v-text-field
v-model="createAccount.password"
autocomplete="off"
required
name="password"
:rules="[
v => !!v || $t('validation.required')
]"
type="password"
persistent-hint
:label="$t('pages.signup.password.label')"
:hint="$t('pages.signup.password.hint')" />
</v-col>
</v-row>
<v-row dense>
<v-col sm="6">
<v-text-field
v-model="password2"
autocomplete="off"
required
name="password-confirm"
:rules="[
v => !!v || $t('validation.required')
]"
:error-messages="password2 && password2 !== this.createAccount.password ? [this.$t('validation.matching')] : []"
type="password"
persistent-hint
:label="$t('pages.signup.confirm.label')"
:hint="$t('pages.signup.confirm.hint')" />
</v-col>
</v-row>
</v-card-text>
<v-card-text>
<v-btn
id="login"
variant="flat"
:disabled="!valid"
color="primary"
type="submit"
name="submit"
:text="$t('pages.signup.submit.label')"
:loading="loading"
@click="register" />
</v-card-text>
</v-card>
</v-form>
</div>
</template>
<script setup>
const { loggedIn, user, login, logout } = useOidcAuth()
</script>
<script>
export default {
data () {
return {
loading: false,
loadingUsers: false,
usernames: [],
error: false, // XXX: `error` is never changed
valid: false,
password2: null,
privacy: false,
consent: false,
createAccount: {
username: null,
email: null,
password: null
}
}
},
mounted () {
this.loadUsers()
},
methods: {
submit () {
this.$refs.form.validate()
},
register () {
this.loading = true
const userService = useUserService()
userService.create(this.createAccount)
.then(() => {
const toast = useToastInstance()
toast.success(this.$t('success.signup'))
this.$router.push('/login')
this.loading = false
})
.catch(({code}) => {
this.loading = false
const toast = useToastInstance()
if (typeof code !== 'string') {
return
}
toast.error(this.$t(code))
})
.finally(() => {
this.loading = false
})
},
loadUsers () {
this.loadingUsers = true
const userService = useUserService()
userService.findAll()
.then((users) => {
this.usernames = users.map(u => u.username)
})
.catch(({code}) => {
this.loadingUsers = false
const toast = useToastInstance()
if (typeof code !== 'string') {
return
}
toast.error(this.$t(code))
})
.finally(() => {
this.loadingUsers = false
})
}
}
}
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment