compared with
Current by Thor Henning Hetland
on Jun 23, 2016 17:30.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (17)

View Page History
h2. Quick set-up (Using Docker on development machine)

* [Install docker|https://docs.docker.com/installation/]
* Start Whydah, ready for Integration
{code}
sudo docker run -it -p 80:9999 -p 9990:9990 -p 9995:9995 -p 9996:9996 -p 9997:9997 -p 9998:9998 totto/whydah bin/bash
/usr/bin/supervisord &
ls -al /home/*/log/
{code}
* Add your application to the Whydah componnets (in Whydah 2.0: add it in securitytykenservice.TEST_LOCALHOST.properties)

h2. Client code example

* [Integration tutorials]


{code}
// Execute a POST to authenticate my application
String myApplicationToken = Request.Post("https://sso.whydah.net/sso/logon")
.bodyForm(Form.form().add("applicationcredential", "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?> <applicationcredential>
<applicationcredential>
<params>
<applicationID>234</applicationID>
<applicationSecret>This is my application secret</applicationSecret>
</params>
</applicationcredential>").build())
<params> <applicationID>234</applicationID> <applicationSecret>applicationsecret</applicationSecret> </params>
</applicationcredential>").build())
.execute().returnContent().asBytes();

String myApplicationTokenID = $(myApplicationToken).xpath("/applicationtoken/params/applicationtokenID[1]");

// Redirect user til SSO login web with my URL as redirect and get userticket back as URL param
// Get userticket from redirect back URL param
//@RequestMapping("/myapp")
//public String myWebApplication(@QueryParam("userticket") String userticket, HttpServletRequest request)
.execute().returnContent().asBytes();

// Get some token values
String userTokenID = $(usertoken).xpath("/usertoken/@id");
NodeList applicationRoleList = $(usertoken).xpath("/usertoken/application");
boolean hasEmployeeRoleInMyApp = $(usertoken).xpath("/usertoken/application[@ID=\"234\"]/role[@name=\"Employee\"");
// Thats all you need to get a full userdatabase, SSO, Facebook/OAUTH support ++
{code}
(Example using Apache HTTP Components Fluent API and jOOX Fluent API)



h2. 1. Getting started - SecurityTokenService and parsing of UserToken
{section}
{code}

// Get some token values
String userTokenID = $(usertoken).xpath("/usertoken/@id");
NodeList applicationRoleList = $(usertoken).xpath("/usertoken/application");
boolean hasEmployeeRoleInMyApp = $(usertoken).xpath("/usertoken/application[@ID=\"234\"]/role[@name=\"Employee\"");


# find my applicationtokeID from returned ApplicationToken
/token/params/applicationtokenID
{column}
{column}
{gliffy:name=Integration - simple standalone|align=left|size=L|version=35}
{column}
{section}
{column}
{column}
{gliffy:name=AuthSequenceStandAlone|align=left|size=L|version=56}
{column}
{section}
h2. 4. User administration for administrators - Introduce UserAdminWebApp
You might want to have a look at the registered users and change them.
For that you might want to run [UserAdminWebApp - UAWA].
Whydah 2.1+ introduces administration of collaborating applications

h2. 45. User administration self service - Introduce UserAdminService
You might want to include some simple self service features in your application, like adding roles to certain users or self registration.
UserAdminService is created to allow for exactly that.
It is however still in an early release.


-----

{include:Whydah development environment installation}