Summary
This document will guide you through the steps to enable a pipe to be called directly by a HTTP client.
System Requirements
- PhenixID Server installed
Instruction
Login to PhenixID Administration Portal
Open a browser and go to https://PhenixidServerIP:8443/config/.
Use e.g. the default administrator user called phenixid to login.
Open Configuration tab
Go to the tab Configuration (needs to be enabled in boot.json, see document http://document.phenixid.net/m/52601/l/513298-enable-configuration-tab-in-phenixid-configuration-manager).
Enable pipes module for HTTP
Locate System Nodes. Click >.
Click on the node you would like to edit. If only one note, click > to the right of 1.
Click > to the right of modules.
Locate the pipes module. Add these parameters to the config part of the pipes-module: "http_enabled" : "true" "http_port" : "<http_port_to_use. By_default_this_should_be_8443>"
The config should look like this after modification (example):
{ "module" : "com.phenixidentity~phenix-pipes~1.5-SNAPSHOT", "enabled" : "true", "config" : { "http_enabled" : "true", "http_port" : "8080", "node_id" : "Anderss-MacBook-Pro.local" }
Restart PhenixID server after the change.
Configure pipe
Locate “Pipes” and click >.
Click on the pen to the right of the Pipe you would like to Edit.
Add these parameters to the pipe you would like to make accessible by HTTP:
“http_enabled” : “true”
“http_path_pattern” : “<HTTP_METHOD>:<URI_TO_BIND_TO>”
<HTTP_METHOD> = The http method (GET, POST, PUT, DELETE) that must be used to call this pipe.
<URI_TO_BIND_TO> = The URI path that must be used to call this pipe.
The config should look like this after modification (example):
{ "id" : "ReadAllUsers", "http_enabled" : "true", "http_path_pattern" : "GET:/pipes/users/", "valves" : [ ....VALVES..... ] }
When done, press Stage changes and then Commit changes.
Restart PhenixID server after committing the changes.
Verify HTTP enabled pipe
- Open a http client
- Create connection to the host and port
- Create request with the corresponding method and uri
- Send the request
- Verify the response to the http client. The response should be in json-format. Example:
{“success”:true,”items”:[{“id”:”cn=msundin,ou=People,dc=bjorken,dc=local”,”properties”:{“displayName”:[“Mats Sundin2″],”givenName”:[“mats”],”type”:[“user”]}}],”error_message”:””,”error_detail_message”:””}
Dynamic parameter in path pattern
It is possible to set part of the path as a dynamic parameter. Example:
"http_path_pattern" : "GET:/pipes/users/:username"
By setting this, it is possible to expand {{request.username}} in the valves used in the pipe.
Example:
{ "id" : "ReadUser", "http_enabled" : true, "http_path_pattern" : "GET:/pipes/user/:username", "valves" : [ { "name" : "LDAPSearchValve", "config" : { "connection_ref" : "local_ldap", "base_dn" : "ou=IPAK,dc=bjorken,dc=local", "scope" : "SUB", "size_limit" : 0, "filter_template" : "(&(objectclass=*)(uid={{request.username}}))", "attributes" : "givenName,sn,uid,mobile" } } ] }
This pipe can be called using http GET, for example https://myserver:8443/pipes/user/bclarke https://myserver:8443/pipes/user/msundin
DISCLAIMER
Information provided in this document is for your information only. PhenixID makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.The origin of this information may be internal or external to PhenixID. PhenixID makes all reasonable efforts to verify this information.
PhenixID - support.phenixid.se