Merge pull request #152 from stianst/master

Keycloak welcome-page. Added logo to login and registration forms. Some minor updates to WildFly example README.md
This commit is contained in:
stianst 2014-01-13 07:18:17 -08:00
commit b684357022
12 changed files with 146 additions and 32 deletions

View file

@ -16,6 +16,7 @@
<outputDirectory>keycloak</outputDirectory>
<excludes>
<exclude>**/*.sh</exclude>
<exclude>welcome-content/*</exclude>
</excludes>
</fileSet>
<fileSet>
@ -34,6 +35,13 @@
<directory>${project.build.directory}/unpacked/adapter</directory>
<outputDirectory>keycloak</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}/unpacked/deployments/auth-server.war</directory>
<outputDirectory>keycloak/welcome-content</outputDirectory>
<includes>
<include>*.*</include>
</includes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>

View file

@ -1,4 +1,4 @@
Login, Distributed SSO, Distributed Logout, and Oauth Token Grant Wildfly Examples
Login, Distributed SSO, Distributed Logout, and OAuth Token Grant Wildfly Examples
===================================
The following examples requires Wildfly 8.0.0. Here's the highlights of the examples
* Delegating authentication of a web app to the remote authentication server via OAuth 2 protocols
@ -7,12 +7,11 @@ The following examples requires Wildfly 8.0.0. Here's the highlights of the exa
* Bearer token authentication and authorization of JAX-RS services
* Obtaining bearer tokens via the OAuth2 protocol
There are multiple WAR projects. These all will run on the same jboss instance, but pretend each one is running on a different
There are multiple WAR projects. These will all run on the same WildFly instance, but pretend each one is running on a different
machine on the network or Internet.
* **customer-app** A WAR applications that does remote login using OAUTH2 browser redirects with the auth server
* **product-app** A WAR applications that does remote login using OAUTH2 browser redirects with the auth server
* **database-service** JAX-RS services authenticated by bearer tokens only. The customer and product app invoke on it
to get data
* **customer-app** A WAR application that does remote login using OAuth2 browser redirects with the auth server
* **product-app** A WAR application that does remote login using OAuth2 browser redirects with the auth server
* **database-service** JAX-RS services authenticated by bearer tokens only. The customer and product app invoke on it to get data
* **third-party** Simple WAR that obtain a bearer token using OAuth2 using browser redirects to the auth-server.
The UI of each of these applications is very crude and exists just to show our OAuth2 implementation in action.
@ -23,30 +22,31 @@ _This demo is meant to run on the same server instance as the Keycloak Server!_
Step 1: Make sure you've set up the Keycloak Server
--------------------------------------
If you've downloaded the Keycloak Appliance Distribution, there is already a Wildfly distro all set up for you. This
Wildfly distro has the adapter jboss modules all installed as well as the keycloak server all set up.
Wildfly distro has the adapter jboss modules all installed as well as the Keycloak Server all set up.
If you want to install Keycloak Server and run the demo on an existing Wildfly instance:
Obtain latest keycloak-war-dist-all.zip. This distro is used to install keycloak onto an existing JBoss installation
$ cd ${jboss.home}/standalone
$ cp -r ${keycloak-war-dist-all}/deployments .
$ cd ${jboss.home}/standalone
$ cp -r ${keycloak-war-dist-all}/deployments .
To install the adapter:
$ cd ${jboss.home}
$ unzip ${keycloak-war-dist-al}/adapters/keycloak-wildfly-adapter-dist.zip
$ cd ${jboss.home}
$ unzip ${keycloak-war-dist-al}/adapters/keycloak-wildfly-adapter-dist.zip
Step 2: Boot Keycloak Server
---------------------------------------
Where you go to start up the Keycloak Server depends on which distro you installed.
$ ./standalone.sh
$ ./bin/standalone.sh
Step 3: Import the Test Realm
---------------------------------------
Next thing you have to do is import the test realm for the demo. Clicking on the below link will bring you to the
create realm page in the admin UI. The username/password is admin/admin to login in. Keycloak will ask you to
create a new password admin password before you can go to the create realm page.
create realm page in the Admin UI. The username/password is admin/admin to login in. Keycloak will ask you to
create a new admin password before you can go to the create realm page.
[http://localhost:8080/auth-server/admin/index.html#/create/realm](http://localhost:8080/auth-server/admin/index.html#/create/realm)
@ -63,13 +63,13 @@ next you must build and deploy
Step 5: Login and Observe Apps
---------------------------------------
Try going to the customer app and viewing customer data:
Try going to the customer app and view customer data:
[http://localhost:8080/customer-portal/customers/view.jsp](http://localhost:8080/customer-portal/customers/view.jsp)
This should take you to the auth-server login screen. Enter username: bburke@redhat.com and password: password.
If you click on the products link, you'll be take to the products app and show a product listing. The redirects
If you click on the products link, you'll be taken to the products app and show a product listing. The redirects
are still happening, but the auth-server knows you are already logged in so the login is bypassed.
If you click on the logout link of either of the product or customer app, you'll be logged out of all the applications.
@ -77,7 +77,7 @@ If you click on the logout link of either of the product or customer app, you'll
Step 6: Traditional OAuth2 Example
----------------------------------
The customer and product apps are logins. The third-party app is the traditional OAuth2 usecase of a client wanting
to get permission to access a user's data. To run this example
to get permission to access a user's data. To run this example open
[http://localhost:8080/oauth-client](http://localhost:8080/oauth-client)
@ -87,10 +87,7 @@ an oauth grant page. This page asks you if you want to grant certain permission
Admin Console
==========================
1. Login
Login:
[http://localhost:8080/auth-server/rest/saas/login](http://localhost:8080/auth-server/rest/saas/login)
[http://localhost:8080/auth-server/admin/index.html](http://localhost:8080/auth-server/admin/index.html)

View file

@ -44,7 +44,7 @@ public class RealmBean {
}
public String getName() {
return saas ? "Keycloak" : realm.getName();
return realm.getName();
}
public RealmModel getRealm() {

View file

@ -51,15 +51,9 @@ public class TemplateBean {
themeConfig.put("styles", themeUrl + "/styles.css");
// TODO move this into CSS
if (realm.isSaas()) {
themeConfig.put("logo", themeUrl + "/img/red-hat-logo.png");
themeConfig.put("background", themeUrl + "/img/login-screen-background.jpg");
themeConfig.put("displayPoweredBy", false);
} else {
themeConfig.put("background", themeUrl + "/img/customer-login-screen-bg2.jpg");
themeConfig.put("displayPoweredBy", true);
}
themeConfig.put("logo", themeUrl + "/img/keycloak-logo.png");
themeConfig.put("background", themeUrl + "/img/login-screen-background.jpg");
themeConfig.put("displayPoweredBy", true);
}
public String getFormsPath() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

View file

@ -75,7 +75,7 @@
<#if template.themeConfig['displayPoweredBy']>
<p class="powered">
<a href="#">${rb.getString('poweredByKeycloak')}</a>
<a href="http://www.keycloak.org">${rb.getString('poweredByKeycloak')}</a>
</p>
</#if>
</div>

View file

@ -0,0 +1,50 @@
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright (c) 2011, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Welcome to WildFly Application Server 8</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="StyleSheet" href="keycloak.css" type="text/css">
</head>
<body>
<div class="wrapper">
<div class="content">
<div class="logo">
<img src="keycloak_logo.png" alt="Keycloak" border="0" />
</div>
<h1>Welcome to Keycloak</h1>
<h3>Your Keycloak is running.</h3>
<p><a href="http://www.keycloak.org/documentation">Documentation</a> | <a href="/auth-server/admin/index.html">Administration Console</a> </p>
<p><a href="http://www.keycloak.org">Keycloak Project</a> |
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user">Mailing List</a> |
<a href="https://issues.jboss.org/browse/KEYCLOAK">Report an issue</a></p>
<p class="logos"><a href="http://www.jboss.org"><img src="jboss_community.png" alt="JBoss and JBoss Community" width="254" height="31" border="0"></a></p>
</div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -0,0 +1,65 @@
/*
~ JBoss, Home of Professional Open Source.
~ Copyright (c) 2011, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
body {
/*background: url(bkg.gif) repeat-x;*/
color: #5B5B5B;
font-family: "Lucida Sans Unicode", "Lucida Grande", Geneva, Verdana, Arial, sans-serif;
margin-top: 100px;
text-align: center;
}
.wrapper {
margin-left: auto;
margin-right: auto;
width: 50em;
text-align: left;
}
a {
text-decoration: none;
color: #5e8a9a;
}
h1 {
padding-top: 20px;
color: #7b1e1e;
}
a:hover {
text-decoration: underline;
color: #8ec6d9;
}
.content {
margin: 0;
padding: 0;
}
.dualbrand {
padding-top: 20px;
}
.wildfly {
float:left;
margin-left: 10px;
}
.logo{
margin-bottom: 10px;
}
.note {
font-size: 8pt;
color: #aaaaaa;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB