Skip to content

Commit 514ad51

Browse files
authored
Merge pull request #73 from serii833/develop
return 401 (Unauthorized) header when missing credentials in request
2 parents 8b51f3a + be62898 commit 514ad51

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

oauth2-server-core/src/main/java/nl/myndocs/oauth2/CallRouter.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ class CallRouter(
160160
"token" -> routeAccessTokenRedirect(callContext, credentials)
161161
else -> throw InvalidGrantException("'grant_type' with value '$responseType' not allowed")
162162
}
163+
} catch (invalidIdentityException: InvalidIdentityException) {
164+
callContext.respondStatus(STATUS_UNAUTHORIZED)
165+
callContext.respondJson(invalidIdentityException.toMap())
166+
return RedirectRouterResponse(false)
163167
} catch (oauthException: OauthException) {
164168
callContext.respondStatus(STATUS_BAD_REQUEST)
165169
callContext.respondJson(oauthException.toMap())

0 commit comments

Comments
 (0)