Commits

Andreas Knecht  committed afe5c61

Fixed a bug where double forward slash would be in the URL if the crowd server did not have a context path (http://jira.atlassian.com).

  • Participants
  • Parent commits a4eacb4

Comments (0)

Files changed (4)

 ## Changes
 
 * 0.0.3 - Added support for newer version of Crowd REST API (contributed by Frank Febbraro)
+* 0.0.4 - Fixed a bug with pathname when there's no context path specified in the crowd url
 
 ## License
 

File examples/login/app.js

 //   with a user object.  In the real world, this would query a database;
 //   however, in this example we are using a baked-in set of users.
 passport.use(new AtlassianCrowdStrategy({
-        crowdServer:"http://localhost:2990/jira",
+        crowdServer:"http://localhost:2990/jira/",
         crowdApplication:"nodejs",
         crowdApplicationPassword:"password",
         retrieveGroupMemberships:true

File lib/passport-atlassian-crowd/strategy.js

                 var groupRequest = http_library.get({
                     host:parsedUrl.hostname,
                     port:parsedUrl.port,
-                    path:parsedUrl.pathname + "/rest/usermanagement/latest/user/group/nested?username=" + username,
+                    path:parsedUrl.pathname + "rest/usermanagement/latest/user/group/nested?username=" + username,
                     headers:{
                         "Content-Type":"application/json",
                         "Accept":"application/json",
     var crowdRequest = http_library.request({
         host:parsedUrl.hostname,
         port:parsedUrl.port,
-        path:parsedUrl.pathname + "/rest/usermanagement/latest/authentication?expand=attributes&username=" + username,
+        path:parsedUrl.pathname + "rest/usermanagement/latest/authentication?expand=attributes&username=" + username,
         method:"POST",
         headers:{
             "Content-Type":"application/json",

File package.json

 {
     "name":"passport-atlassian-crowd",
-    "version":"0.0.3",
+    "version":"0.0.4",
     "description":"Password authentication strategy using Atlassian Crowd for Passport",
     "author":{
         "name":"Andreas Knecht",