Permalink
Browse files

Allow Identity servers with url params

Such as google apps.
  • Loading branch information...
tobi committed Jan 19, 2012
1 parent ba03b2a commit 152fb4dfeb2485329f03ec92d4ff1e4d779af75b
Showing with 12 additions and 3 deletions.
  1. +12 −3 authrequest.go
View
@@ -97,10 +97,19 @@ func CreateAuthenticationRequest(OPEndPoint, ClaimedID, Realm, ReturnTo string)
p["openid.realm"] = Realm
var url_ string
- url_ = OPEndPoint + "?"
+
+ if strings.Index(OPEndPoint, "?") == -1 {
+ url_ = OPEndPoint + "?"
+ } else {
+ url_ = OPEndPoint + "&"
+ }
+
+ var params []string
for k, v := range p {
- url_ += url.QueryEscape(k) + "=" + url.QueryEscape(v) + "&"
+ params = append(params, url.QueryEscape(k) + "=" + url.QueryEscape(v))
+
}
- return url_
+
+ return url_ + strings.Join(params, "&")
}

0 comments on commit 152fb4d

Please sign in to comment.