Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IA2
GMS
Commits
ea65db8f
Commit
ea65db8f
authored
Jul 06, 2020
by
Sonia Zorba
Browse files
SessionData bugfix
parent
f3024b5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
gms/src/main/java/it/inaf/ia2/gms/controller/JWTWebServiceController.java
View file @
ea65db8f
...
...
@@ -231,7 +231,7 @@ public class JWTWebServiceController {
response
.
setStatus
(
HttpServletResponse
.
SC_NO_CONTENT
);
}
@GetMapping
(
value
=
{
"/permission/{group:.+}"
,
"/permission
/
"
},
produces
=
MediaType
.
TEXT_PLAIN_VALUE
)
@GetMapping
(
value
=
{
"/permission/{group:.+}"
,
"/permission"
},
produces
=
MediaType
.
TEXT_PLAIN_VALUE
)
public
void
getUserPermission
(
@PathVariable
(
"group"
)
Optional
<
String
>
groupNames
,
@RequestParam
(
"user_id"
)
Optional
<
String
>
userId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
if
(
userId
.
isPresent
())
{
...
...
gms/src/main/java/it/inaf/ia2/gms/rap/RapClient.java
View file @
ea65db8f
...
...
@@ -103,7 +103,7 @@ public class RapClient {
try
{
return
function
.
apply
(
getEntity
(
body
));
}
catch
(
HttpClientErrorException
.
Unauthorized
ex
)
{
if
(
sessionData
==
null
)
{
if
(
request
.
getSession
(
false
)
==
null
)
{
// we can't refresh the token without a session
throw
ex
;
}
...
...
@@ -116,7 +116,7 @@ public class RapClient {
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setAccept
(
Collections
.
singletonList
(
MediaType
.
APPLICATION_JSON
));
if
(
sessionData
!=
null
)
{
if
(
request
.
getSession
(
false
)
!=
null
)
{
headers
.
add
(
"Authorization"
,
"Bearer "
+
sessionData
.
getAccessToken
());
}
else
{
// from JWT web service
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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