telenordigital / connect-ios-sdk

Docs šŸ“’šŸ‘‰
https://telenordigital.github.io/id-docs.telenordigital.com/integrate-ios-sdk.html
Apache License 2.0
9 stars 8 forks source link

scope elements in auth url are separated by + instead of space #12

Closed jorunfa closed 8 years ago

jorunfa commented 8 years ago
var scope: String {
        get {
            // Create a string to concatenate all scopes existing in the _scopes array.
            var scopeString = ""
            for scope in self.scopes {
                scopeString += scope.urlEncode()
                // If the current scope is other than the last one, then add the "+" sign to the string to separate the scopes.
                if (scope != self.scopes.last) {
                    scopeString += "+"
                }
            }
            return scopeString
        }
    }

should be urlEncoded space instead:

list (required) Example: openid profile email A space-delimited list of scope values for authorization. If you want to use OpenID Connect, you must pass openid as one of the scope values.

http://docs.telenordigital.com/apis/connect/id/authentication.html#authorization-server-user-authorization

Multiple scope values MAY be used by creating a space delimited, case sensitive list of ASCII scope values.

http://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims

A test should also be added to verify the correct behavior