Skip to content

Commit 4b7c1fe

Browse files
committed
Fix invalid access type
1 parent c44d73e commit 4b7c1fe

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

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)