website/integrations/cloud-providers/digitalocean/index.md
DigitalOcean is a cloud infrastructure provider that offers developers simple, scalable virtual servers (droplets), managed databases, and other cloud services to deploy and manage applications efficiently.
The following placeholders are used in this guide:
authentik.company is the FQDN of the authentik installation.:::info This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application. :::
To support the integration of DigitalOcean with authentik, you need to create a scope mapping as well as an application/provider pair in authentik.
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Customization > Property Mappings and click Create.
Click Scope Mapping, Next, and fill the following required information:
profile# Extract the names of all groups the user belongs to
group_names = user.groups.values_list("name", flat=True)
# From the group names, filter out those that start with "do:"
# Strip off the "do:" prefix so we’re left with just the role name
do_roles = [n[3:] for n in group_names if n and n[:3].casefold() == "do:"]
# You can find all predefined roles at: https://docs.digitalocean.com/platform/teams/roles/predefined/
# You can find documentation for custom roles at: https://docs.digitalocean.com/platform/teams/roles/custom/
priority = ["Owner", "Admin", "Member"]
# Pick the first matching role based on priority order
# (e.g. if user has both "do:Admin" and "do:Member", they'll get "Admin")
chosen = next((r for p in priority for r in do_roles if r == p), None)
# Return a dict with the team role if one was chosen, otherwise return an empty dict
return {"team_role": [chosen]} if chosen else {}
Click Finish.
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Applications > Applications and click Create with Provider to create an application and provider pair. (Alternatively you can first create a provider separately, then create the application and connect it with the provider.)
Strict redirect URI to https://cloud.digitalocean.com/sessions/sso/callback.profile scope created in the previous section. Do not remove authentik’s authentik default OAuth Mapping: OpenID 'profile', as claims such as name are required by DigitalOcean.Click Submit to save the new application and provider.
https://authentik.company/application/o/<application_slug>/To verify the integration of authentik with DigitalOcean, navigate to the authentik User interface and click the DigitalOcean application to initiate a Single Sign-On login. Upon successful login, you should be redirected to the DigitalOcean dashboard and have the appropriate permissions set by your authentik groups.