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
bf0cd43d
Commit
bf0cd43d
authored
Mar 09, 2021
by
michael.simon
Browse files
add more details to refresh token update
parent
9ee4910c
Changes
1
Hide whitespace changes
Inline
Side-by-side
bwreg-service/src/main/java/edu/kit/scc/webreg/service/oidc/client/OidcUserUpdater.java
View file @
bf0cd43d
...
...
@@ -24,6 +24,7 @@ import com.nimbusds.jose.JOSEException;
import
com.nimbusds.jose.JWSAlgorithm
;
import
com.nimbusds.jose.proc.BadJOSEException
;
import
com.nimbusds.jwt.JWT
;
import
com.nimbusds.jwt.JWTParser
;
import
com.nimbusds.oauth2.sdk.AuthorizationGrant
;
import
com.nimbusds.oauth2.sdk.ErrorObject
;
import
com.nimbusds.oauth2.sdk.ParseException
;
...
...
@@ -161,7 +162,7 @@ public class OidcUserUpdater implements Serializable {
}
else
{
OIDCTokenResponse
oidcTokenResponse
=
(
OIDCTokenResponse
)
tokenResponse
.
toSuccessResponse
();
logger
.
debug
(
"response: {}"
,
oidcTokenResponse
.
to
String
());
logger
.
debug
(
"response: {}"
,
oidcTokenResponse
.
to
JSONObject
());
JWT
idToken
=
oidcTokenResponse
.
getOIDCTokens
().
getIDToken
();
IDTokenClaimsSet
claims
=
null
;
...
...
@@ -183,6 +184,14 @@ public class OidcUserUpdater implements Serializable {
}
RefreshToken
refreshToken
=
oidcTokenResponse
.
getOIDCTokens
().
getRefreshToken
();
try
{
JWT
refreshJwt
=
JWTParser
.
parse
(
refreshToken
.
getValue
());
// Well, what to do with this info? Check if refresh token is short or long lived? <1 day?
logger
.
info
(
"refresh will expire at: {}"
,
refreshJwt
.
getJWTClaimsSet
().
getExpirationTime
());
}
catch
(
java
.
text
.
ParseException
e
)
{
logger
.
debug
(
"Refresh token is no JWT"
);
}
BearerAccessToken
bearerAccessToken
=
oidcTokenResponse
.
getOIDCTokens
().
getBearerAccessToken
();
HTTPResponse
httpResponse
=
new
UserInfoRequest
(
...
...
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