Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
reg-app
Regapp
Commits
56bdd9fd
Commit
56bdd9fd
authored
Nov 24, 2020
by
michael.simon
Browse files
now really fix oidc login
parent
a59410f7
Changes
1
Show whitespace changes
Inline
Side-by-side
bwreg-service/src/main/java/edu/kit/scc/webreg/service/oidc/OidcOpLoginImpl.java
View file @
56bdd9fd
...
...
@@ -290,6 +290,14 @@ public class OidcOpLoginImpl implements OidcOpLogin {
throw
new
OidcAuthenticationException
(
"No identity attached to flow state."
);
}
UserEntity
user
;
if
(
identity
.
getUsers
().
size
()
==
1
)
{
user
=
identity
.
getUsers
().
iterator
().
next
();
}
else
{
user
=
identity
.
getPrefUser
();
}
RegistryEntity
registry
=
flowState
.
getRegistry
();
/*
...
...
@@ -307,7 +315,7 @@ public class OidcOpLoginImpl implements OidcOpLogin {
.
claim
(
"nonce"
,
flowState
.
getNonce
())
.
audience
(
flowState
.
getClientConfiguration
().
getName
())
.
issueTime
(
new
Date
())
.
subject
(
flowState
.
getU
ser
()
.
getEppn
())
.
subject
(
u
ser
.
getEppn
())
.
build
();
for
(
ServiceOidcClientEntity
serviceOidcClient
:
serviceOidcClientList
)
{
...
...
@@ -323,8 +331,8 @@ public class OidcOpLoginImpl implements OidcOpLogin {
Invocable
invocable
=
(
Invocable
)
engine
;
invocable
.
invokeFunction
(
"buildTokenStatement"
,
scriptingEnv
,
claimsBuilder
,
identity
,
registry
,
serviceOidcClient
.
getService
(),
logger
);
invocable
.
invokeFunction
(
"buildTokenStatement"
,
scriptingEnv
,
claimsBuilder
,
user
,
registry
,
serviceOidcClient
.
getService
(),
logger
,
identity
);
}
catch
(
NoSuchMethodException
|
ScriptException
e
)
{
logger
.
warn
(
"Script execution failed. Continue with other scripts."
,
e
);
}
...
...
@@ -389,10 +397,19 @@ public class OidcOpLoginImpl implements OidcOpLogin {
}
List
<
ServiceOidcClientEntity
>
serviceOidcClientList
=
serviceOidcClientDao
.
findByClientConfig
(
clientConfig
);
UserEntity
user
=
flowState
.
getUser
();
if
(
user
==
null
)
{
throw
new
OidcAuthenticationException
(
"No user attached to flow state."
);
IdentityEntity
identity
=
flowState
.
getIdentity
();
if
(
identity
==
null
)
{
throw
new
OidcAuthenticationException
(
"No identity attached to flow state."
);
}
UserEntity
user
;
if
(
identity
.
getUsers
().
size
()
==
1
)
{
user
=
identity
.
getUsers
().
iterator
().
next
();
}
else
{
user
=
identity
.
getPrefUser
();
}
RegistryEntity
registry
=
flowState
.
getRegistry
();
...
...
@@ -413,7 +430,7 @@ public class OidcOpLoginImpl implements OidcOpLogin {
Invocable
invocable
=
(
Invocable
)
engine
;
invocable
.
invokeFunction
(
"buildClaimsStatement"
,
scriptingEnv
,
claimsBuilder
,
user
,
registry
,
serviceOidcClient
.
getService
(),
logger
);
serviceOidcClient
.
getService
(),
logger
,
identity
);
}
catch
(
NoSuchMethodException
|
ScriptException
e
)
{
logger
.
warn
(
"Script execution failed. Continue with other scripts."
,
e
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment