-
Create an account for Auth0 and login
-
From the dashboard, click "New Application"
-
Enter a name and choose "Single Page Web Applications"
-
Click on "Settings" and gather the relevant information and update the file
docs/yaml/02-configmap.yaml
and apply to cluster -
Update the "Allowed Callback URLs" to match the "redirectURL" parameter in the configmap configured previously
-
Click "Save Changes"
-
Add Rule for adding group metadata by clicking on "Rules" from the menu
-
Give the rule a name and copy/paste the following:
function (user, context, callback) { if (user.app_metadata && 'groups' in user.app_metadata) { context.idToken.groups = user.app_metadata.groups; } else { context.idToken.groups = []; } callback(null, user, context); }
-
Configure API Server with the following config replacing issuer-url & client-id values:
--oidc-issuer-url=https://example.auth0.com/ --oidc-client-id=<clientid> --oidc-username-claim=email --oidc-groups-claim=groups
A typical gangway config for Auth0:
clusterName: "YourCluster"
authorizeURL: "https://example.auth0.com/authorize"
tokenURL: "https://example.auth0.com/oauth/token"
clientID: "<your client ID>"
clientSecret: "<your client secret>"
audience: "https://example.auth0.com/userinfo"
redirectURL: "https://gangway.example.com/callback"
scopes: ["openid", "profile", "email", "offline_access"]
usernameClaim: "sub"
emailClaim: "email"
apiServerURL: "https://kube-apiserver.yourcluster.com"