I am newbie in DevOps and would like to learn from you more about Crowd REST API SSO application.
I am researching how to perform authentication/SSO via Crowd for /git resources where reverse proxy is NGIX.
It was nice to see what 95% of it is done via simple https://github.com/kenshaw/nginx-crowd-lua
I would like to get attributes (groups) in the authorisation request.
$ curl -i -u git:APP_PWD --data-binary @pwd.json http://localhost:8095/crowd/rest/usermanagement/1/authentication?username=SAMPLE_USER&expand=attributes --header 'Content-Type: application/json' --header 'Accept: application/json'
[1] 21545
-bash: --header: command not found
Pranass-MacBook-Pro:tmp pb$ HTTP/1.1 415 Unsupported Media Type
Server: Apache-Coyote/1.1
X-Embedded-Crowd-Version: Crowd/2.8.0
X-Crowd-User-Management-Version: 1.4
Set-Cookie: JSESSIONID=FA46F0A8763D60D0430D7C2D83D0B92D; Path=/crowd/; HttpOnly
X-Content-Type-Options: nosniff
Content-Type: text/html;charset=utf-8
Content-Language: en
Content-Length: 1092
Date: Tue, 17 Mar 2015 07:13:14 GMT
<html><head><title>Apache Tomcat/7.0.54 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 415 - Unsupported Media Type</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>Unsupported Media Type</u></p><p><b>description</b> <u>The server refused this request because the request entity is in a format not supported by the requested resource for the requested method.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.54</h3></body></html>
It would be nice to hear if someone has tried to solve similar task and share experience and tips. It would be perfect to get groups in the single response. I'd check for crowd groups (e.g. git-rw and git-ro) and add set HTTP session parameter used by backend system.
Thank you!