happydpc / goauth2

Automatically exported from code.google.com/p/goauth2
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

document multiple scopes #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Attempt to encode multiple scopes in any possible format
2. The scopes are double encoded or otherwise unacceptable by Google OAuth2
3. Try other combinations, repeat.

What is the expected output? What do you see instead?

Setting the &oauth.Config Scope should not be double encoded

What version of the product are you using? On what operating system?

osx, latest

Please provide any additional information below.

I have not been able to work aroundt he pr

Original issue reported on code.google.com by skizz...@gmail.com on 22 Mar 2013 at 9:59

GoogleCodeExporter commented 9 years ago
Can you give me an example configuration with multiple scopes? (make sure to 
redact your client id and secret)

Original comment by a...@golang.org on 25 Mar 2013 at 10:34

GoogleCodeExporter commented 9 years ago
 I just figured this out.  It is not documented anywhere, however you can separate scopes with a space which will be encoded properly.

Original comment by skizz...@gmail.com on 26 Mar 2013 at 12:22

GoogleCodeExporter commented 9 years ago
So the scopes are just URLs? Can you please give me an example? That way I can 
document it.

Original comment by a...@golang.org on 26 Mar 2013 at 12:27

GoogleCodeExporter commented 9 years ago
Sorry, not in front of my code at the moment, however it went something like 
this...

import strings

scopes := []string {
 "https://example.com/scope1",
 "https://example.com/scope2"
}

config := &oauth.Config{
                ...
                Scope: strings.Join(scopes, " "),
                ...
        }

or simply...

 Scope: "https://foo/1 https://foo/2" //space between urls

I can post a full example tomorrow. I was working on adding support for a 
"Scopable" interface to support Scope structs, however I realized during the 
testing that it would encode properly given a simple space separation.

Original comment by skizz...@gmail.com on 26 Mar 2013 at 12:37

GoogleCodeExporter commented 9 years ago

Original comment by a...@golang.org on 8 Apr 2013 at 4:27

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 66eb1571a0d4.

Original comment by willnorris@google.com on 19 Jun 2013 at 1:22