Search in sources :

Example 1 with ProfileResult

use of org.dcache.gplazma.oidc.ProfileResult in project dcache by dCache.

the class OidcProfileTest method when.

private void when(ProfileInvocationBuilder builder) throws AuthenticationException {
    ProfileResult result = builder.invoke();
    principals = result.getPrincipals();
    restriction = result.getRestriction();
}
Also used : ProfileResult(org.dcache.gplazma.oidc.ProfileResult)

Example 2 with ProfileResult

use of org.dcache.gplazma.oidc.ProfileResult in project dcache by dCache.

the class ScitokensProfileTest method when.

private void when(ProfileInvocationBuilder builder) throws AuthenticationException {
    ProfileResult result = builder.invoke();
    principals = result.getPrincipals();
    restriction = result.getRestriction();
}
Also used : ProfileResult(org.dcache.gplazma.oidc.ProfileResult)

Example 3 with ProfileResult

use of org.dcache.gplazma.oidc.ProfileResult in project dcache by dCache.

the class WlcgProfileTest method when.

private void when(ProfileInvocationBuilder builder) throws AuthenticationException {
    ProfileResult result = builder.invoke();
    principals = result.getPrincipals();
    restriction = result.getRestriction();
}
Also used : ProfileResult(org.dcache.gplazma.oidc.ProfileResult)

Example 4 with ProfileResult

use of org.dcache.gplazma.oidc.ProfileResult in project dcache by dCache.

the class OidcProfile method processClaims.

@Override
public ProfileResult processClaims(IdentityProvider ip, Map<String, JsonNode> claims) throws AuthenticationException {
    ProfileResult result = super.processClaims(ip, claims);
    var extraPrincipals = extraPrincipals(claims);
    return result.withPrincipals(extraPrincipals);
}
Also used : ProfileResult(org.dcache.gplazma.oidc.ProfileResult)

Example 5 with ProfileResult

use of org.dcache.gplazma.oidc.ProfileResult in project dcache by dCache.

the class ScopeBasedAuthzProfile method processClaims.

@Override
public ProfileResult processClaims(IdentityProvider idp, Map<String, JsonNode> claims) throws AuthenticationException {
    ProfileResult result = super.processClaims(idp, claims);
    var node = claims.get("scope");
    checkAuthentication(node != null, "Missing 'scope' claim");
    checkAuthentication(node.isTextual(), "'scope' claim has wrong type: %s", node.getNodeType());
    String scopeClaim = node.asText();
    List<AuthorisationSupplier> authorisationStatements = parseScope(scopeClaim);
    if (!authorisationStatements.isEmpty()) {
        var newRestriction = buildRestriction(authorisationStatements);
        var newPrincipals = Streams.concat(authzIdentity.stream(), AUTHZ_IDENTITY.stream()).collect(Collectors.toList());
        result = result.withPrincipals(newPrincipals).withRestriction(newRestriction);
    } else {
        result = result.withPrincipals(nonAuthzIdentity);
    }
    return result;
}
Also used : ProfileResult(org.dcache.gplazma.oidc.ProfileResult)

Aggregations

ProfileResult (org.dcache.gplazma.oidc.ProfileResult)6