Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,296,274
Community Members
 
Community Events
165
Community Groups

crowd gitweb/gitolite ngix

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!

1 answer

Error log:

crowd_1 | 2015-03-17 07:13:14,638 http-bio-8095-exec-3 ERROR [jersey.spi.container.ContainerRequest] A message body reader for Java class com.atlassian.crowd.plugin.rest.entity.PasswordEntity, and Java type class com.atlassian.crowd.plugin.rest.entity.PasswordEntity, and MIME media type application/x-www-form-urlencoded was not found.
crowd_1 | The registered message body readers compatible with the MIME media type are:
crowd_1 | */* ->
crowd_1 |   com.sun.jersey.core.impl.provider.entity.FormProvider
crowd_1 |   com.sun.jersey.core.impl.provider.entity.StringProvider
crowd_1 |   com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
crowd_1 |   com.sun.jersey.core.impl.provider.entity.FileProvider
crowd_1 |   com.sun.jersey.core.impl.provider.entity.InputStreamProvider
crowd_1 |   com.sun.jersey.core.impl.provider.entity.DataSourceProvider
crowd_1 |   com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
crowd_1 |   com.sun.jersey.core.impl.provider.entity.ReaderProvider
crowd_1 |   com.sun.jersey.core.impl.provider.entity.DocumentProvider
crowd_1 |   com.sun.jersey.core.impl.provider.entity.SourceProvider$StreamSourceReader
crowd_1 |   com.sun.jersey.core.impl.provider.entity.SourceProvider$SAXSourceReader
crowd_1 |   com.sun.jersey.core.impl.provider.entity.SourceProvider$DOMSourceReader
crowd_1 |   com.sun.jersey.json.impl.provider.entity.JSONJAXBElementProvider$General
crowd_1 |   com.sun.jersey.json.impl.provider.entity.JSONArrayProvider$General
crowd_1 |   com.sun.jersey.json.impl.provider.entity.JSONObjectProvider$General
crowd_1 |   com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
crowd_1 |   com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
crowd_1 |   com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$General
crowd_1 |   com.sun.jersey.core.impl.provider.entity.EntityHolderReader
crowd_1 |   com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider$General
crowd_1 |   com.sun.jersey.json.impl.provider.entity.JSONListElementProvider$General
crowd_1 |   com.sun.jersey.json.impl.provider.entity.JacksonProviderProxy
crowd_1 | application/x-www-form-urlencoded ->
crowd_1 |   com.sun.jersey.core.impl.provider.entity.FormProvider
crowd_1 |   com.sun.jersey.core.impl.provider.entity.FormMultivaluedMapProvider

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Jira Service Management

Jira Service Management Documentation Opportunities

Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...

314 views 0 9
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you