diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-07-12 14:33:15 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-07-12 14:33:15 +0300 |
commit | 8a8cc760db2a7a086838250c7bc092d2e6c56e1c (patch) | |
tree | 630f4730fb98ed8bd0fd587ff7461bd67cb980dd /create-token | |
parent | e2fad93e9ee63828695edb5b12f1d1fe29bc504f (diff) | |
download | qvisqve-8a8cc760db2a7a086838250c7bc092d2e6c56e1c.tar.gz |
Add: let user specify scopes in the token
Diffstat (limited to 'create-token')
-rwxr-xr-x | create-token | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/create-token b/create-token index cf99c93..c2f2785 100755 --- a/create-token +++ b/create-token @@ -25,6 +25,7 @@ import apifw filename = sys.argv[1] aud = sys.argv[2] +scopes = sys.argv[3] key_text = open(filename, 'r').read() key = Crypto.PublicKey.RSA.importKey(key_text) @@ -35,7 +36,7 @@ claims = { 'sub': 'subject-uuid', 'aud': aud, 'exp': now + 3600, - 'scope': 'openid person_resource_id uapi_orgs_get uapi_orgs_post' + 'scope': scopes, } token = apifw.create_token(claims, key) |