server: add scope to newLoginURLFromSession

need to make sure the scope is present otherwise will be considered an invalid request

fixes #135
This commit is contained in:
Marcus Stong 2015-11-18 14:16:35 -05:00
parent 728b64c3cf
commit 7d0ecf9532

View file

@ -296,6 +296,9 @@ func newLoginURLFromSession(issuer url.URL, ses *session.Session, register bool,
if msgCode != "" { if msgCode != "" {
v.Set("msg_code", msgCode) v.Set("msg_code", msgCode)
} }
if len(ses.Scope) > 0 {
v.Set("scope", strings.Join(ses.Scope, " "))
}
loginURL.RawQuery = v.Encode() loginURL.RawQuery = v.Encode()
return &loginURL return &loginURL