This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.4.4. Customizing the login page
Create Terms of Service information with custom login pages. 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.
Prerequisites
- You must have administrator privileges.
Procedure
Run the following commands to create templates you can modify:
oc adm create-login-template > login.html
$ oc adm create-login-template > login.html
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc adm create-provider-selection-template > providers.html
$ oc adm create-provider-selection-template > providers.html
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc adm create-error-template > errors.html
$ oc adm create-error-template > errors.html
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the secrets:
oc create secret generic login-template --from-file=login.html -n openshift-config
$ oc create secret generic login-template --from-file=login.html -n openshift-config
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc create secret generic providers-template --from-file=providers.html -n openshift-config
$ oc create secret generic providers-template --from-file=providers.html -n openshift-config
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc create secret generic error-template --from-file=errors.html -n openshift-config
$ oc create secret generic error-template --from-file=errors.html -n openshift-config
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run:
oc edit oauths cluster
$ oc edit oauths cluster
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the specification:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run
oc explain oauths.spec.templates
to understand the options.