Customize the login page
You can customize the login page to display Terms of Service information or apply custom branding for third-party login providers.
Custom login pages can also be helpful if you use a third-party login provider, such as GitHub or Google, to show users a branded page that they trust and expect before being redirected to the authentication provider. You can also render custom error pages during the authentication process.
|
|
Customizing the error template is limited to identity providers (IDPs) that use redirects, such as request header and OIDC-based IDPs. It does not have an effect on IDPs that use direct password authentication, such as LDAP and htpasswd. |
-
You must have administrator privileges.
-
Run the following commands to create templates you can modify:
$ oc adm create-login-template > login.html$ oc adm create-provider-selection-template > providers.html$ oc adm create-error-template > errors.html -
Create the secrets:
$ oc create secret generic login-template --from-file=login.html -n openshift-config$ oc create secret generic providers-template --from-file=providers.html -n openshift-config$ oc create secret generic error-template --from-file=errors.html -n openshift-config -
Run:
$ oc edit oauths cluster -
Update the specification:
apiVersion: config.openshift.io/v1 kind: OAuth metadata: name: cluster # ... spec: templates: error: name: error-template login: name: login-template providerSelection: name: providers-templateRun
oc explain oauths.spec.templatesto understand the options.