Commit graph

348 commits

Author SHA1 Message Date
Sjoerd Langkemper
2fc4c138b3 Make (user, client) unique on UserConsent
We assume this combination is unique with our get and get_or_create
calls.
2015-11-10 11:29:05 +01:00
Nick Mohoric
16208c1092 Fix incorrect mixture of %s and format 2015-11-02 11:19:03 -05:00
Juan Ignacio Fiorentino
4c9dfefedd Merge pull request #52 from pabluk/creatersakey-command-py3
Fix creatersakey management command support for Python 3.x
2015-10-19 17:10:42 -03:00
Pablo SEMINARIO
db977f65a6 Append binary file mode to write RSA exported key needed by Python 3 2015-10-19 21:46:25 +02:00
Pablo SEMINARIO
b89115165c Fix use of deprecated Exception.message in Python 3 2015-10-19 21:46:25 +02:00
Pablo SEMINARIO
daee582207 Remove unused CommandError import 2015-10-19 21:46:25 +02:00
Pablo SEMINARIO
36f8bcbb5d Add a basic test for the creatersakey management command 2015-10-19 21:46:25 +02:00
juanifioren
20cc2a1b20 Fix Unicode bug in Client model. 2015-10-19 16:38:41 -03:00
Pablo SEMINARIO
6ff48091e5 Fix #49 updating pyjwkest version to 1.0.6
pyjwkest has changed the type of value returned by the `long_to_base64`
function, now it returns unicode.
2015-10-17 23:49:59 +02:00
juanifioren
9a685a7afa Merge from ByteInternet:refresh-tokens 2015-09-30 12:59:08 -03:00
Maarten van Schaik
893a877b76 Upgrade pyjwkest to version > 1.0.3
There have been some issues in Python 3 where elements of the id_token
were left when encoding the token. Cause was incorrect encoding logic in
pyjwkest. Version 1.0.3 has improved encoding handling.
2015-09-30 17:31:49 +02:00
Maarten van Schaik
f4dfa7303f Forget old token when a refresh token is used 2015-09-30 16:46:33 +02:00
Maarten van Schaik
8d672cc1ba Add support for refresh_token to token endpoint 2015-09-30 14:55:48 +02:00
Maarten van Schaik
03d2770f5e Store refresh token 2015-09-30 12:42:04 +02:00
juanifioren
c76f73eb7e Bump version 0.2.0. 2015-09-25 17:24:58 -03:00
juanifioren
5311888520 Merge branch 'v0.1.x' of https://github.com/juanifioren/django-oidc-provider into v0.2.x
Conflicts:
	README.rst
2015-08-12 15:21:57 -03:00
Rob Sung
19313e8145 Fxed: ID token does not contain kid #42 2015-08-11 23:50:05 -04:00
juanifioren
18b492d1db Add tests for userinfo claims. 2015-08-11 15:59:57 -03:00
juanifioren
5020ccde80 Add custom user info model feature. 2015-08-11 15:58:52 -03:00
juanifioren
165c316bbe Add new migrations. 2015-08-05 14:51:18 -03:00
juanifioren
d6d7e60ef5 Remove UserInfo from admin.py. 2015-08-05 13:21:17 -03:00
juanifioren
6aa656e361 Remove UserInfo Model. 2015-08-05 13:19:53 -03:00
juanifioren
8040dd7670 Remove unnecessary property in error class. 2015-08-03 15:09:12 -03:00
juanifioren
e178f8c1a9 Add token_endpoint_auth_methods_supported to discovery. 2015-07-31 14:59:33 -03:00
juanifioren
7658257d18 Refactoring in discovery. 2015-07-31 14:19:53 -03:00
juanifioren
83c21cec40 Add tests for HTTP Basic Client auth. 2015-07-30 15:49:48 -03:00
juanifioren
6c4dad8c5c Imports in alphabetical order. 2015-07-30 15:49:12 -03:00
juanifioren
870c605211 Add HTTP Basic client auth in token endpoint. 2015-07-30 15:47:50 -03:00
juanifioren
87b0deb357 Merge branch 'v0.1.x' of https://github.com/juanifioren/django-oidc-provider 2015-07-28 15:56:00 -03:00
juanifioren
253527aa52 Refactoring in authorize endpoint. 2015-07-28 15:55:30 -03:00
juanifioren
46b0c2f244 Add test to authorize endpoint. 2015-07-28 15:54:52 -03:00
juanifioren
92b75ba1d9 Sending access_token as query string parameter in UserInfo. 2015-07-27 18:28:12 -03:00
juanifioren
cd2b47dac1 Merge branch 'master' of https://github.com/juanifioren/django-oidc-provider 2015-07-27 16:07:21 -03:00
juanifioren
401a35f68f Encode id_token in tests. 2015-07-27 15:51:19 -03:00
juanifioren
a640b33dd6 Convert "aud" to str in create_id_token function. 2015-07-27 15:50:02 -03:00
Ignacio
064b36d615 Fix tests with pyjwkest package. 2015-07-27 11:35:05 -03:00
Ignacio
bedd114929 Use pyjwkest in encode_id_token function. 2015-07-27 11:33:28 -03:00
Maarten van Schaik
6e513cfb73 Add tests for logout view 2015-07-24 12:13:31 +02:00
Maarten van Schaik
76efb6fc68 Add logout view to enable minimal session mgmt
This implements a very small part of the OIDC session management as
described in
http://openid.net/specs/openid-connect-session-1_0-17.html#rfc.section.5.

It does not implement the full session management (using iframes) and
does not implement the registration and verification of logout redirect
uri's.
2015-07-24 11:36:45 +02:00
juanifioren
162416bfae Add missing encode in test. 2015-07-23 16:28:20 -03:00
juanifioren
01bf1ee5e6 In python 3 use "int" instead of "long". 2015-07-23 16:22:42 -03:00
juanifioren
895ca36ab5 Add decode "utf-8" to jwks_uri view. My fault! 2015-07-23 16:17:28 -03:00
juanifioren
d17efb7f0c Add encode "utf-8" to jwks_uri view. 2015-07-23 16:13:26 -03:00
juanifioren
0445f737f2 Fix unicode error python3. 2015-07-23 16:07:55 -03:00
Maarten van Schaik
85eb13b1f9 Don't filter all falsy claims
Sometimes you do want the value False, or 0, or any datetime value at
midnight. (http://lwn.net/Articles/590299/)
2015-07-23 15:03:01 +02:00
juanifioren
9b3ba5652f Add idtoken_sign_validation test. 2015-07-22 18:22:46 -03:00
juanifioren
b9806ed102 Remove unnecessary settings rewrite in tests. 2015-07-22 16:25:17 -03:00
Maarten van Schaik
f8366b18f7 Explicitly import the right settings 2015-07-21 15:59:23 +02:00
Maarten van Schaik
77230af4c3 Use models setting instead of User 2015-07-21 15:57:23 +02:00
juanifioren
2de1394202 Add id_token_signing_alg_values_supported to discovery endpoint. 2015-07-17 11:52:58 -03:00
juanifioren
a08dbdb7d2 Merge branch 'master' of https://github.com/juanifioren/django-oidc-provider into v0.1.0-dev
Conflicts:
	example_project/.gitignore
2015-07-17 11:32:14 -03:00
juanifioren
91ae9ba9ff Add one test for request not containing nonce parameter. 2015-07-16 15:58:33 -03:00
juanifioren
882def8124 Fix tests for using nonce parameter. 2015-07-16 15:04:33 -03:00
juanifioren
a690a57a03 Fix nonce parameter inside token endpoint. 2015-07-16 14:25:58 -03:00
juanifioren
6dde3a59a8 Add nonce to Code model. Modify create_code function. 2015-07-15 16:23:36 -03:00
juanifioren
0de868941a Modify create_id_token function for supporting nonce. 2015-07-15 16:18:34 -03:00
juanifioren
c995da640c Remove _extract_implicit_params function. 2015-07-15 15:17:47 -03:00
juanifioren
6fc6126a62 Add nonce to _extract_params function. 2015-07-15 15:16:51 -03:00
Sjoerd Langkemper
0882c5c63b Make the sub a string
In the default sub generator. The spec says "The sub value is a case
sensitive string."
2015-07-15 12:17:21 +02:00
Sjoerd Langkemper
00f30dabbf Convert times to int
Make iat_time, exp_time, auth_time an integer, not a float. The spec
does not explicitly forbit float times, but some clients don't accept
this (mod_auth_openidc), and `timetuple()` has second precision anyway
so we don't loose any information.
2015-07-15 12:06:02 +02:00
juanifioren
80f89889bb Add example key file for tests. 2015-07-14 15:01:32 -03:00
juanifioren
1736d7b7ae Add IOError custom message when rsa key file is missing. 2015-07-14 15:01:01 -03:00
juanifioren
211f942eec Fix imports in tests. 2015-07-14 14:52:48 -03:00
juanifioren
051c29a262 Refactoring tests. 2015-07-14 13:27:46 -03:00
juanifioren
fa7d64c04b Add OIDC_RSA_KEY_FOLDER to settings. 2015-07-14 13:01:29 -03:00
juanifioren
f52db34d00 Reorder imports. 2015-07-14 12:44:25 -03:00
juanifioren
5371fbfba9 Merge branch 'master' of https://github.com/juanifioren/django-oidc-provider into v0.1.0-dev
Conflicts:
	oidc_provider/lib/endpoints/authorize.py
2015-07-13 17:47:19 -03:00
juanifioren
82c0e7874e Add jwks endpoint to discovery. 2015-07-13 17:38:38 -03:00
juanifioren
fe153f51a6 Correct encode_id_token function. 2015-07-13 17:38:03 -03:00
juanifioren
3498940142 Encode id_toke with using RSA now. 2015-07-13 17:37:13 -03:00
juanifioren
f7e8fa460c Create get_rsa_key function to obtain the key from filesystem. 2015-07-13 17:36:15 -03:00
juanifioren
5ba5b1581d Add Jwks url to urls.py. 2015-07-13 17:35:18 -03:00
juanifioren
a22fc7c1a1 Add Jwks view to views.py. 2015-07-13 17:34:43 -03:00
juanifioren
7e52112a31 Add missing __init__ file. 2015-07-13 17:18:13 -03:00
juanifioren
2fc83f6aa6 Add missing __init__ file. 2015-07-13 16:25:11 -03:00
juanifioren
9eb5f67a95 Add a command for creating rsa key. 2015-07-13 15:49:08 -03:00
Juan Ignacio Fiorentino
1faeb6d5ab Merge pull request #31 from ByteInternet/nonce-in-id-token
Add nonce in id_token when included in auth request
2015-07-10 10:29:55 -03:00
Maarten van Schaik
a4fcf956c2 Add nonce in id_token when included in auth request
http://openid.net/specs/openid-connect-core-1_0.html#IDToken

If present in the Authentication Request, Authorization Servers MUST
include a nonce Claim in the ID Token with the Claim Value being the
nonce value sent in the Authentication Request.

This patch adds the nonce to the id_token.
2015-07-10 14:44:26 +02:00
Maarten van Schaik
7632054aad Add support for redirect_uris with query params
Some clients might add extra parameters to the redirect_uri, for
instance as extra verification if proper state parameter handling is not
supported.

This patch adds proper handling of redirect_uris with query parameters.
2015-07-10 12:22:25 +02:00
juanifioren
27110b65e4 Use decode with utf-8 encoding. 2015-07-01 17:20:16 -03:00
juanifioren
447d026a41 Add urllib and change iteritems() with items(). 2015-07-01 16:43:35 -03:00
juanifioren
e2a0f8ec60 Add urllib compatibility. 2015-07-01 12:53:41 -03:00
juanifioren
74212d6961 Clean test. 2015-07-01 12:26:00 -03:00
juanifioren
197818566d Rename setting. 2015-06-24 12:40:00 -03:00
juanifioren
4021441c76 Add test for user consent skip feature. 2015-06-23 16:32:12 -03:00
juanifioren
44bbe78723 Clean templates in tests. 2015-06-23 15:05:47 -03:00
juanifioren
503324ae66 Add user consent logic to authorize endpoint. 2015-06-22 18:42:42 -03:00
juanifioren
544861abec Add UserConsent to models. 2015-06-22 18:42:04 -03:00
juanifioren
9211b4200a Add settings for user consent. 2015-06-22 18:41:42 -03:00
juanifioren
fea181bf41 Add migrations for user consent. 2015-06-22 18:40:38 -03:00
juanifioren
68b4847219 Refactoring error logging. 2015-06-19 17:46:00 -03:00
juanifioren
b659dd95d3 Fix in settings when importing from string. 2015-06-19 15:37:42 -03:00
juanifioren
bcb144dcdb Now OIDC_EXTRA_SCOPE_CLAIMS must be a string (lazy imported). 2015-06-19 15:19:46 -03:00
juanifioren
8f47f906de Fix when returning address_formatted. 2015-06-16 14:35:07 -03:00
juanifioren
48fcb1da93 Move validate_params function to views (on POST authorize). 2015-06-15 17:34:36 -03:00
juanifioren
06392c7600 Clean logging on test settings. 2015-06-15 17:23:47 -03:00
juanifioren
124c7366fa Move allow logic to authorize view. 2015-06-15 16:04:44 -03:00
niccolasmendoza@gmail.com
521708f718 adding logger for tests 2015-06-08 16:36:49 -03:00
niccolasmendoza@gmail.com
c385609b35 adding test settings, templates.. 2015-06-08 13:01:09 -03:00
niccolasmendoza@gmail.com
cfbfbfc74a removing unnecesary imports 2015-06-08 12:32:55 -03:00
Chris Gough
e9ed60d16c add __str__ and __unicode__ methods to models so they look better in the admin pages 2015-05-30 21:54:04 +10:00
juanifioren
800bb55f43 Fix string indentation. 2015-05-14 12:44:08 -03:00
juanifioren
6a696453fc Clean error messages. 2015-05-13 18:36:04 -03:00
juanifioren
7a82c352fd Add scope validation in userinfo endpoint. 2015-05-07 16:12:45 -03:00
juanifioren
e92308e421 Add tests for scope validation in userinfo endpoint. 2015-05-07 16:08:12 -03:00
juanifioren
03634f90e9 Add tests for userinfo endpoint. 2015-05-07 15:47:49 -03:00
juanifioren
06fb967bf8 Add import for reverse function in tests. 2015-05-07 15:47:00 -03:00
Juan Ignacio Fiorentino
2529fef5ba Fix test_authorize_endpoint messages. 2015-04-30 12:42:00 -03:00
juanifioren
4b3039ceae Refactoring for create_id_token function. 2015-04-29 18:55:48 -03:00
juanifioren
e773083e7d Bump version 0.0.4. 2015-04-22 11:53:19 -03:00
juanifioren
99ec0675ee Add missing previously removed migration. 2015-04-21 17:43:00 -03:00
juanifioren
180e0183c5 Validate expiration of access_token in UserInfo. 2015-04-21 17:14:26 -03:00
juanifioren
0f03bdfb67 Add abstract class for Code and Token models. 2015-04-21 15:19:43 -03:00
juanifioren
9b321fef9a Fix conditional for code expiration. 2015-04-21 14:28:59 -03:00
Juan Ignacio Fiorentino
4fb06c93ba Merge pull request #20 from presencelearning/fixing_implicit_flow
Fixed id_token dict in implicit flow.
2015-04-18 17:29:48 -03:00
Francois Gaudin
4c16097f40 Fixed id_token dict in implicit flow 2015-04-17 15:41:04 -07:00
Francois Gaudin
c521e81722 Adding models into the admin 2015-04-17 13:21:32 -07:00
juanifioren
63cb8351b8 Make address_formatted a property inside UserInfo model. 2015-04-15 14:54:42 -03:00
juanifioren
a1df576d1c Important fix in recursive function. 2015-03-31 15:31:17 -03:00
juanifioren
07e80d5d5c Fix in tests when setting a hook. 2015-03-30 15:37:48 -03:00
juanifioren
0df97dfb72 Add choices to gender in UserInfo. 2015-03-27 14:42:41 -03:00
juanifioren
b7d4c4377d Reuse the scope function in models. 2015-03-20 14:38:28 -03:00
juanifioren
4e53ee7fa9 Merge branch 'master' of https://github.com/juanifioren/django-openid-provider 2015-03-19 14:19:36 -03:00
juanifioren
f85a4c1d7f No need of that naming in authorize tests. 2015-03-19 14:19:27 -03:00
Juan Ignacio Fiorentino
91c9c4158c Remove unnecessary tag in authorize template. 2015-03-19 14:10:30 -03:00
juanifioren
2d3bf16b58 Add OIDC_AFTER_USERLOGIN_HOOK setting. 2015-03-19 14:04:32 -03:00
Juan Ignacio Fiorentino
5c415c8da7 Delete 0001_initial.py 2015-03-12 14:38:55 -03:00
juanifioren
1ec93d480f Add test_token_endpoint. 2015-03-12 12:43:21 -03:00
juanifioren
46f57ae7f2 Unnecessary assignment in test_authorize_endpoint. 2015-03-12 12:42:52 -03:00
juanifioren
7e690f4e68 Move Grant Code creation logic into a functon. 2015-03-12 12:40:36 -03:00
juanifioren
dda38fd451 Fix in authorize endpoint tests. 2015-03-11 14:36:52 -03:00
juanifioren
c9c5982c35 Add provider info test. Add some msg to tests. 2015-03-06 12:56:35 -03:00
juanifioren
2c76393c09 Move class instantiation in settings. 2015-03-06 12:55:50 -03:00
juanifioren
e3b5af5490 Add setup to extra scope claims. 2015-03-06 12:54:27 -03:00
juanifioren
a97ef2b5cf Set default settings using class attr. 2015-03-04 17:17:37 -03:00
juanifioren
3ad316cdca Add Provider Configuration Information endpoint. 2015-03-04 16:24:41 -03:00
juanifioren
964d649d3d Remove client from sub generator. 2015-03-03 13:39:32 -03:00
juanifioren
3190599967 Add custom SUB generator for ID TOKEN. 2015-03-02 17:37:54 -03:00
juanifioren
07c92e8182 Complete some tests. Also change a few things on them. 2015-02-27 17:40:17 -03:00
juanifioren
e542514491 Merge branch 'master' of https://github.com/juanifioren/django-openid-provider 2015-02-26 16:15:07 -03:00
juanifioren
94ccfc54cf Change "DOP" with "OIDC" in settings. 2015-02-26 16:14:36 -03:00
Jorge Vazquez
cc9ac6889f Merge branch 'master' into code_changes 2015-02-23 15:07:32 -03:00
Jorge Vazquez
0b10f94a06 Adding removed fields that are required by the specs 2015-02-23 15:02:26 -03:00
juanifioren
e40a62cecc Add doc to tests. 2015-02-20 14:33:18 -03:00
juanifioren
e64612cc40 Merge branch 'master' of https://github.com/juanifioren/django-openid-provider 2015-02-19 15:57:20 -03:00
juanifioren
dedc70b05a Edit tests. 2015-02-19 15:45:51 -03:00
Jorge Vazquez
c44309c540 Model definition changes 2015-02-18 16:25:34 -03:00
juanifioren
2bac30361e Change name of the package. 2015-02-18 15:07:22 -03:00