All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cloud.security.ams.api.AuthorizationMode Maven / Gradle / Ivy

Go to download

Client Library for integrating Jakarta EE applications with SAP Authorization Management Service (AMS)

The newest version!
/************************************************************************
 * © 2019-2023 SAP SE or an SAP affiliate company. All rights reserved. *
 ************************************************************************/
package com.sap.cloud.security.ams.api;

/**
 * The AuthorizationMode is derived from certain claim and value combinations in the token
 * and is used to determine if the PolicyDecisionPoint should be called with a specific set of
 * policies {@link com.sap.cloud.security.ams.dcl.client.pdp.Attributes#setPolicies(String...)}
 * or if a scope filter needs to be set {@link com.sap.cloud.security.ams.dcl.client.pdp.Attributes#setScopeFilterPolicies(String...)}.
 */
public enum AuthorizationMode {
    /**
     * This mode indicates an application to application API call using technical communication.
     * It is indicated by a not empty {@code ias_apis} claim and equal values for the claims {@code sub} and {@code azp}.
     */
    API_TECHNICAL(PolicyAssignmentMode.EFFECTIVE_POLICIES),
    /**
     * This mode indicates an application to application API call with a named user.
     * It is indicated by a not empty {@code ias_apis} claim and not equal values for the claims {@code sub} and {@code azp}.
     */
    API_USER(PolicyAssignmentMode.SCOPE_FILTER),
    /**
     * This mode indicates that none of the other modes was detected.
     */
    NONE(PolicyAssignmentMode.NONE);

    private final PolicyAssignmentMode policyAssignmentMode;

    AuthorizationMode(PolicyAssignmentMode policyAssignmentMode) {
        this.policyAssignmentMode = policyAssignmentMode;
    }

    public PolicyAssignmentMode getPolicyAssignmentMode() {
        return this.policyAssignmentMode;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy