This article describes how to set up Blocks single-sign-on using the popular OKTA SSO service provider.
server: type: pixilab_server auth: urlResolver: null ajaxRequestResolver: null callbackUrl: http://[BLOCKS-DOMAIN-OR-IP]/rest/auth/callback rolesOwner: attributes rolesPath: roles rolesMapping: BlocksRoleAdmin: Admin BlocksRoleManager: Manager BlocksRoleCreator: Creator BlocksRoleEditor: Editor BlocksRoleContributor: Contributor BlocksRoleStaff: Staff clients: - org.pac4j.oidc.client.OidcClient: configuration: discoveryURI: [YOUR-OKTA-SUBDOMAIN]/.well-known/openid-configuration clientId: [CLIENT-ID] secret: [CLIENT-SECRET] clientAuthenticationMethod: client_secret_basic scope: openid profile groups servlet: security: - matchers: internalMatcher clients: OidcClient authorizers: isAuthenticated applicationConnectors: useForwardedHeaders: true
When the roles (through groups) you've added to your Okta configuration does not match the roles used by blocks, as per our description in the section above (step 6). You can add role mapping to the Blocks configuration file. You do this by defining a server.auth.rolesMapping parameter where the keys are the roles of your Okta configuration and the values the roles Blocks know about. For example:
rolesMapping: BlocksRoleAdmin: Admin BlocksRoleManager: Manager BlocksRoleCreator: Creator BlocksRoleEditor: Editor BlocksRoleContributor: Contributor BlocksRoleStaff: Staff
This mapping is already included in the configuration example, but it can be a good thing to keep in mind if your roles look different from what we configured in step 6 of the section above.