Skip to content

Authorisation

Authorisation#

Authorisation is configured in one or more *[authorisation.] sections. It contains per-OP authorisation.

Defaults for the authorisation.* sections can be set in the magic section [DEFAULT]. These options are available and explained below.

  • op_url: OpenID Provider URL (required)
  • scopes: Required OIDC scopes
  • authorise_all: Allow all users from this OP (default: False)
  • authorised_users: List of authorized users by ‘sub’ claim
  • authorised_vos: List of authorized Virtual Organizations
  • vo_claim: OIDC claim containing VOs (default: eduperson_entitlement)
  • vo_match: How many VOs to match - all, one, or integer (default: one)
  • audience: Audience claim for this service (optional)
  • authorised_admins: Admin users who can suspend/resume accounts
  • authorise_admins_for_all_ops: Allow admins to manage users from any OP

Note

  • The ‘op_url’ field is mandatory for each authorisation section
  • Unknown claims in tokens are ignored (won’t cause authorisation failure)
  • We use delegated Access Tokens I.e. there is no need to register a client_id/client_secret with a provider.
  • JWT access tokens are supported natively (issuer is read from the token). Non-JWT access tokens are also supported: oinit will prompt the user for the issuer URL in that case. When using oidc-agent with a non-JWT token, oidc-agent automatically supplies the issuer.

[DEFAULT] section#

The [DEFAULT] section sets the defaults for all [authorisation.<provider_name>] sections. These options are supported:

  • scopes - The required scopes from the OP to access the service
    default: scopes = ["openid", "profile", "email", "eduperson_entitlement"]

  • authorise_all - Authorise all users from trusted OP.
    default: authorise_all = False

  • authorised_vos - List of VOs whose members are authorised to use the service
    default: authorised_vos []

  • vo_claim - the OIDC claim containing the VOs specified above
    default: vo_claim = eduperson_entitlement

  • vo_match - how many VOs need to be matched from the list, valid options: all, one, or an int
    default: vo_match = one

  • authorised_users = list of individual users authorised to use the
    service specified through OIDC ‘sub’, relative to the section’s OP defaults to empy list if not specified
    default: authorised_users = []

    Info

    You can find out your sub and VOs you are a member of by using flaat:

         $ pip install flaat
         $ flaat-userinfo $TOKEN
    
    where $TOKEN contains an Access Token from the OP you are interested it.

    A commandline tool to retrieve access tokens is: oidc-agent

  • audience - audience claim specific to this service (OPTIONAL); it can
    be a string or a list of strings if empty or not specified, audience checking will not be used for authorisation
    Be aware that many OPs do not support this feature, in which case it will be ignored, and not be used for authorisation.
    default: audience = ""

  • authorised_admins - Admin Authorisation

    Info

    Each OP includes authorisation for the /admin endpoint, which allows suspending and resuming access for individual users.
    Only individual admins can be authorised (by ‘sub’ claim). This is meant for infrastructure security contacts. In the future, we plan to support this feature for VO managers too, to suspend members of their own VO (by using VO roles encoded in AARC-G002 entitlements).

    default: authorised_admins = []

[authorisation.<provider_name>]#

Each [authorisation.<provider_name>] section is used to configure one OP (OpenID Provider). You can set the provider_name yourself.

Each [authorisation.<provider_name>] section overrides the any of the [DEFAULT] options. the op_url must be specified.

  • op_url - OIDC provider URL (mandatory)

Examples#

Basic example#

Here is an example for how to configure the EGI Checkin OP to authorise any user of the VO identified by its entitlement "urn:mace:egi.eu:group:my-group:role=member". In addition, also allow th user "ea1b8e21-3654-4178-bd04-98c6adf58951" known at the EGI OP.

[authorisation.egi]
# The complete URL for the OIDC provider (MANDATORY)
op_url = https://aai.egi.eu/auth/realms/egi

# Authorise based on Virtual Organisation membership (entitlements)
authorised_vos = ["urn:mace:egi.eu:group:my-group:role=member"]
vo_claim = eduperson_entitlement

# Authorise specific individual users
authorised_users = ["ea1b8e21-3654-4178-bd04-98c6adf58951"]

To treat users who have shown their passport at their Home-IdP differently from those who have not, use assurance-based shell tiers. They are configured in the same [DEFAULT] / [authorisation.*] sections:

assurance_based_shell_tier_full = profile/espresso | profile/cappuccino
assurance_based_shell_tier_restricted = *

Users matching the first expression get the normal shell; everyone else gets the restricted one.

Multiple Identity Providers#

You can configure different authorisation rules for each provider:

[authorisation.kit]
op_url = https://oidc.scc.kit.edu/auth/realms/kit
# Only allow members of KIT
vo_claim = eduperson_scoped_affiliation
authorised_vos = ["member@kit.edu", "student@kit.edu"]

[authorisation.google]
op_url = https://accounts.google.com
# Only allow specific email domains
vo_claim = email
vo_list = [".*@example\.com"]
[authorisation.helmholtz]
op_url = https://login.helmholtz.de/oauth2/
# Require specific entitlements (from the default claim: eduperson_entitlement)
authorised_vos = ["urn:geant:helmholtz.de:group:my-project:role=member"]