I’m trying to setup owncloud with single sign on using Authentik. I have it working for normal users. There is a feature that allows automatic role assignment to users so that admin users from authentik become admin users for owncloud.
This is described here: https://doc.owncloud.com/ocis/next/deployment/services/s-list/proxy.html#automatic-role-assignments.
In this document, they describe having attributes like
- role_name: admin
claim_value: ocisAdmin
The problem I have is I don’t know how to input this information into an Authentik user. As a result, owncloud is giving me this error:
ERR Error mapping role names to role ids error="no roles in user claims" line=github.com/owncloud/ocis/v2/services/proxy/pkg/userroles/oidcroles.go:84 request-id=5a6d0e69-ad1b-4479-b2d9-30d4b4afb8f2 service=proxy userid=05b283cd-606c-424f-ae67-5d0016f2152c
Any authentik experts out there?
I tried putting this under the attributes section of the user profile in authentik:
role_name: admin
claim_value: ocisAdmin
It doesn’t work and it won’t let me format YAML like the documentation where the claim_value
is a child of the role_name
.
You can do this by replacing an existing scope or creating a new one. In some cases I’ve needed to replace an existing scope with custom mappings, and add the information needed to it. For example I created a custom scope of ‘profile’, added the relevant claim needed along with the standard scope information, and then associated that to the provider.
To do that, you add an OAuth scope mapping,. That mapping will then add the desired claim information. These are created with small python scripts. Set them to add the relevant claim when a case is matched (ex. User is in group “Admins”). Name the scope “profile”, though it could be a new scope (preferred) if owncloud lets you specify them.
In the provider for owncloud add that new or replacement scope. In the Edit settings that’s found under Advanced Protocol Settings. You’d add the named scope that correlates to your recently created Claim.
Then verify everything is working as expected; Go to Preview for that Provider. While it won’t show you scope names, it will combine the claims into the JWT preview which is convenient for validating you did everything correctly. It helps reduce the extra variable of Owncloud until you get to that point.