protected ServerAuthorizationCodeGrant doCreateCodeGrant(AuthorizationCodeRegistration reg)
     throws OAuthServiceException {
   ServerAuthorizationCodeGrant grant =
       new ServerAuthorizationCodeGrant(
           reg.getClient(), getCode(reg), getGrantLifetime(), getIssuedAt());
   grant.setApprovedScopes(getApprovedScopes(reg));
   grant.setAudience(reg.getAudience());
   grant.setClientCodeChallenge(reg.getClientCodeChallenge());
   grant.setSubject(reg.getSubject());
   grant.setRedirectUri(reg.getRedirectUri());
   return grant;
 }
 protected List<String> getApprovedScopes(AuthorizationCodeRegistration reg) {
   return reg.getApprovedScope();
 }