Skip to content

Commit 83dca4f

Browse files
committed
Merge branch 'hotfix/21.1.5'
2 parents c44d73e + 1a58265 commit 83dca4f

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
We follow the CalVer (https://calver.org/) versioning scheme: YY.MINOR.MICRO.
44

5+
21.1.5 (04-14-2021)
6+
===================
7+
8+
Fix invalid access type for OAuth /authorize
9+
510
21.1.4 (04-14-2021)
611
===================
712

src/main/java/org/apereo/cas/support/oauth/web/endpoints/OAuth20AuthorizeEndpointController.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,14 @@ protected ModelAndView buildAuthorizationForRequest (
245245
.map(String::valueOf)
246246
.orElseGet(OAuth20GrantTypes.AUTHORIZATION_CODE::getType)
247247
.toUpperCase();
248-
val accessType = context
248+
var accessType = context
249249
.getRequestParameter(OsfCasOAuth20Constants.ACCESS_TYPE)
250250
.map(String::valueOf)
251-
.orElse(OsfCasOAuth20CodeType.ONLINE.name())
251+
.orElse(StringUtils.EMPTY)
252252
.toUpperCase();
253+
if (!OsfCasOAuth20CodeType.OFFLINE.name().equalsIgnoreCase(accessType)) {
254+
accessType = OsfCasOAuth20CodeType.ONLINE.name();
255+
}
253256
val scopes = OAuth20Utils.parseRequestScopes(context);
254257
val codeChallenge = context
255258
.getRequestParameter(OAuth20Constants.CODE_CHALLENGE)

0 commit comments

Comments
 (0)