use of org.apache.cxf.rs.security.oidc.idp.OidcUserSubject in project cxf by apache.
the class SubjectCreatorImpl method createUserSubject.
@Override
public OidcUserSubject createUserSubject(MessageContext mc, MultivaluedMap<String, String> params) {
OidcUserSubject oidcSub = new OidcUserSubject(OAuthUtils.createSubject(mc, (SecurityContext) mc.get(SecurityContext.class.getName())));
final List<String> scopes;
String requestedScope = params.getFirst(OAuthConstants.SCOPE);
if (requestedScope != null && !requestedScope.isEmpty()) {
scopes = OidcUtils.getScopeClaims(requestedScope.split(" "));
} else {
scopes = Collections.emptyList();
}
oidcSub.setIdToken(ID_TOKEN_PROVIDER.getIdToken(null, oidcSub, scopes));
return oidcSub;
}
Aggregations