oidc: fix OpenID Connect scope option

There is a missmatch between the option being defined in the
OpenIDConnectPassword loader and the OidcPassword class. The loader
defines it as "openid-scope" but the OidcPassword constructor only
accepts "scope".

Closes-Bug: 1594272
Change-Id: I7dbaaa4eb52c900bcd19da4c274bd35dc8b98c6f
This commit is contained in:
Alvaro Lopez Garcia 2016-06-23 13:09:58 +02:00
parent aa01e5fe38
commit bd18bc3d0d
2 changed files with 3 additions and 0 deletions

View File

@ -111,6 +111,7 @@ class OpenIDConnectPassword(_OpenIDConnectBase):
loading.Opt('username', help='Username'),
loading.Opt('password', secret=True, help='Password'),
loading.Opt('openid-scope', default="profile",
dest='scope',
help='OpenID Connect scope that is requested from OP')
])

View File

@ -150,6 +150,8 @@ class OpenIDConnectPasswordTests(OpenIDConnectBaseTests, utils.TestCase):
set(['username', 'password', 'openid-scope']).issubset(
set([o.name for o in options]))
)
# openid-scope gets renamed into "scope"
self.assertIn('scope', [o.dest for o in options])
def test_basic(self):
access_token_endpoint = uuid.uuid4().hex