federation-id-prov


Component description

Contrail package federation-id-prov provides RESTful API for the Identity provider towards the Contrail federation. It provides also SAML assertions for federation attributes.

Missing

Patch file for  /etc/tomcat6/server.xml .

Resources used

  • Tomcat6
  • HTTP port 8081
  • HTTPS port 8444

Configuration Files

Configuration file resides under

/etc/contrail/federation-id-prov/federation-id-db.conf

Under

/usr/share/contrail/federation-id-prov

file structure is copied that is to be included into SimpleSAMLphp installation provided by contrail-federation-id-prov-support package.

/etc/contrail/federation-id-prov/federation-id-db.conf

Nothing is there to be changed in the configuration at this point. Federation API access point will be provided soon.


authz-enabled=false
authz-file=/etc/contrail/federation-id-prov/federation-id-prov.access

Public API - federation-api

List of federation-api resource sections:

  • users
  • attributes

Section: Users

Resource URL: /users

REST call GET

Description

  Returns the list of all federation users.

Example request
GET http://172.16.117.111:8080/federation-api/users
Example result
HTTP/1.1 200 OK
Content-Type: application/json
[{"username":"coordinator","uri":"/users/1"},{"username":"admin","uri":"/users/2"},{"username":"contrailuser","uri":"/users/3"}]

REST call POST

Description

Creates new user with a UID.

Parameters

 

username
  • required: true
  • description: Name of the user
  • example value: contrailuser
attributes
  • required: false
  • description: additional user attributes (JSON)
  • example value: any JSON content
firstName
  • required: false
  • description: Name of the user.
  • example value: Any name
lastName
  • required: false
  • description: Last name of the user.
  • example value: Any surname
email
  • required: true
  • description: email of the user
  • example value: user@contrail.net
password
  • required: true
  • description: password of the new user
  • example value: any password
Example request

 

POST --header "Content-Type: application/json" -d '{"username":"admin", "password":"password", "firstName":"User", "lastName":"Contrail"}' http://hostname:8080/federation-api/users
Example result

 
HTTP/1.1 201 Created Location: http://localhost:8080/federation-api/users/3

Resource URL: /users/ID

REST call GET

Description

Returns the description of the user with the given ID.

Example request
GET http://172.16.117.111:8080/federation-api/users/3
Example result
HTTP/1.1 200 OK
Content-Type: application/json
{"lastName":"User","ids":"/users/3/ids","password":"$2a$06$DCq7YPn5Rq63x1Lad4c11.P4fII8YTYrgf3o7Jq9Q9i..OjKvLrFm","ovfs":"/users/3/ovfs","slas":"/users/3/slas","username":"contrailuser","providers":"/users/3/providers","email":"demo.user@contrail.eu","slats":"/users/3/slats","roles":"/users/3/roles","applications":"/users/3/applications","uuid":"cb96e102-82f7-4c5f-a8f0-23149aa6a936","attributes":"/users/3/attributes","firstName":"Demo","groups":"/users/3/groups"}

REST call PUT

Description

Updates the user with the given id.

Parameters

 

attributes
  • required: false
  • description: additional user attributes (JSON)
  • example value: any JSON content
firstName
  • required: false
  • description: Name of the user.
  • example value: Any name
lastName
  • required: false
  • description: Last name of the user.
  • example value: Any surname
email
  • required: false
  • description: email of the user
  • example value: user@contrail.net
password
  • required: false
  • description: password of the new user
  • example value: any password
Example request
PUT --header "Content-Type: application/json" -d '{"password":"new_password", "firstName":"User2", "lastName":"Contrail2"}' http://hostname:8080/federation-api/users/3
Example result
HTTP/1.1 204 No Content

Section: Attributes

Resource URL: /attributes

REST call GET

Description
Example request
GET http://172.16.117.111:8081/federation-id-prov/attributes
Example result

REST call POST

Description
Parameters

 

username
attributes
firstName
lastName

 

email
password
Example request

 

Example result