Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sso
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
sso
Commits
886e8e16
Commit
886e8e16
authored
Jul 24, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
385053b5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
OAuthApi.java
src/main/java/com/egolm/sso/api/OAuthApi.java
+10
-3
No files found.
src/main/java/com/egolm/sso/api/OAuthApi.java
View file @
886e8e16
...
...
@@ -51,7 +51,7 @@ public interface OAuthApi {
}
}
default
OAuthToken
getOAuthToke
n
()
{
default
OAuthToken
doLogi
n
()
{
try
{
HttpServletRequest
request
=
this
.
getHttpServletRequest
();
HttpSession
session
=
request
.
getSession
();
...
...
@@ -83,7 +83,14 @@ public interface OAuthApi {
}
}
default
OAuthToken
refreshOAuthToken
()
{
default
void
doLogout
()
{
HttpServletRequest
request
=
this
.
getHttpServletRequest
();
HttpSession
session
=
request
.
getSession
();
session
.
removeAttribute
(
OAUTH_TOKEN_SESSION
);
session
.
invalidate
();
}
default
OAuthToken
refresh
()
{
try
{
HttpServletRequest
request
=
this
.
getHttpServletRequest
();
HttpSession
session
=
request
.
getSession
();
...
...
@@ -124,7 +131,7 @@ public interface OAuthApi {
String
resBody
=
resourceResponse
.
getBody
();
return
resBody
;
}
catch
(
OAuthProblemException
e
)
{
this
.
refresh
OAuthToken
();
this
.
refresh
();
return
doRequest
(
method
,
url
,
parameters
);
}
catch
(
Exception
e
)
{
throw
new
OAuthApiException
(
e
.
getMessage
(),
e
);
...
...
Write
Preview
Markdown
is supported
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