File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/main/java/com/authlete/jaxrs/server/api Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ public Response post(
7777 BasicCredentials credentials = BasicCredentials .parse (authorization );
7878
7979 // Fetch the information about the resource server from DB.
80- ResourceServerEntity rsEntity = ResourceServerDao . get (credentials . getUserId () );
80+ ResourceServerEntity rsEntity = getResourceServer (credentials );
8181
8282 // If failed to authenticate the resource server.
8383 if (authenticateResourceServer (rsEntity , credentials ) == false )
@@ -110,6 +110,17 @@ private Params buildParams(
110110 }
111111
112112
113+ private ResourceServerEntity getResourceServer (BasicCredentials credentials )
114+ {
115+ if (credentials == null )
116+ {
117+ return null ;
118+ }
119+
120+ return ResourceServerDao .get (credentials .getUserId ());
121+ }
122+
123+
113124 private boolean authenticateResourceServer (
114125 ResourceServerEntity rsEntity , BasicCredentials credentials )
115126 {
You can’t perform that action at this time.
0 commit comments