# Keycloak on OpenShift

DevFeed: [Keycloak on OpenShift](<https://devfeed.tech/articles/keycloak-on-openshift-31570.md>)

Original publisher: [Read original article](<https://www.keycloak.org/2018/05/keycloak-on-openshift>)

Author: Stian Thorgersen

Published: 2018-05-31T00:00:00Z

Content type: tutorial

Language: en

Sources: [Keycloak Blog](<https://devfeed.tech/sources/keycloak-blog.md>)

Topics: [Keycloak](<https://devfeed.tech/topics/keycloak.md>), [Node.js](<https://devfeed.tech/topics/node-js.md>), [HTML5](<https://devfeed.tech/topics/html5.md>)

Tags: [deployment](<https://devfeed.tech/tags/deployment.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [html5](<https://devfeed.tech/tags/html5.md>), [idm](<https://devfeed.tech/tags/idm.md>), [kerberos](<https://devfeed.tech/tags/kerberos.md>), [keycloak](<https://devfeed.tech/tags/keycloak.md>), [ldap](<https://devfeed.tech/tags/ldap.md>), [node-js](<https://devfeed.tech/tags/node-js.md>), [openid-connect](<https://devfeed.tech/tags/openid-connect.md>), [openshift](<https://devfeed.tech/tags/openshift.md>), [saml](<https://devfeed.tech/tags/saml.md>), [sso](<https://devfeed.tech/tags/sso.md>)

## AI overview

A tutorial showing how to deploy Keycloak on OpenShift, then deploy a Node.js REST service and an HTML5 application and secure both with Keycloak.

## Source excerpt

In this post you'll see how to deploy Keycloak on OpenShift. You'll also learn how to deploy a Node.js based REST service and an HTML5 application to OpenShift and secure these with Keycloak. There is also a screencast showing this example at https://youtu.be/9zUWqbK3BqI. If you don't already have OpenShift available a good place to start is by using MiniShift. Deploying Keycloak First of all create a new project in OpenShift with oc by running: oc new-project keycloak The next thing to do is to import the Keycloak template into OpenShift, by running: oc replace --force -f "https://raw.githubusercontent.com/jboss-dockerfiles/keycloak"\ "/master/openshift-examples/keycloak-https.json" Now open the OpenShift console and open the keycloak project. Click on Add to Project and Browse Catalog. In the catalog you should find Keycloak. Click on it. Click next on the information. Under configuration set a username and password that you can remember in the Keycloak Administrator Username and Keycloak Administrator Password fields. Then click on create. Click on Continue to project overview. Wait for the deployment to complete then click on the link to the application. Your browser will complain about the certificate as it is a self-signed certificate. Ignore this and proceed. Click on Administration Console, then login with the username and password you entered previously. Keep this tab open as you will need it later. You have now deployed Keycloak onto OpenShift. Configure Clients in Keycloak We need to create clients for the service and the application we will secure. Open the tab with the Keycloak admin console. Click on Clients and Create. For Client ID enter service and click Save. Under Access Type select bearer-only and click on Save. Click on Clients then Create again. For Client ID enter app and click Save. For Valid Redirect URIs and Web Origins enter *. In production environment it is very important that you enter the correct URL for your application, but since thi