-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathoidc_server_conf.py
More file actions
103 lines (102 loc) · 3.34 KB
/
oidc_server_conf.py
File metadata and controls
103 lines (102 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
from common import CRYPT_CONFIG
from common import SESSION_PARAMS
from common import full_path
from idpyoidc.server.authz import AuthzHandling
from idpyoidc.server.client_authn import verify_client
from idpyoidc.server.user_authn.authn_context import INTERNETPROTOCOLPASSWORD
SERVER_CONF = {
"issuer": "https://example.com/",
"httpc_params": {"verify": False, "timeout": 1},
"subject_types_supported": ["public", "pairwise", "ephemeral"],
"endpoint": {
"provider_info": {
"path": ".well-known/oauth-authorization-server",
"class": "idpyoidc.server.oidc.provider_config.ProviderConfiguration",
"kwargs": {},
},
"authorization": {
"path": "authorization",
"class": "idpyoidc.server.oidc.authorization.Authorization",
"kwargs": {},
},
"token": {
"path": "token",
"class": "idpyoidc.server.oidc.token.Token",
"kwargs": {},
},
"userinfo": {
"path": "userinfo",
"class": "idpyoidc.server.oidc.userinfo.UserInfo",
"kwargs": {
"client_authn_method": ["bearer_header", "bearer_body"],
"base_claims": {
"email": {"essential": True},
"email_verified": {"essential": True},
}
},
}
},
"authentication": {
"anon": {
"acr": INTERNETPROTOCOLPASSWORD,
"class": "idpyoidc.server.user_authn.user.NoAuthn",
"kwargs": {"user": "diana"},
}
},
"userinfo": {
"class": "idpyoidc.server.user_info.UserInfo",
"kwargs": {"db_file": full_path("users.json")},
},
"client_authn": verify_client,
"authz": {
"class": AuthzHandling,
"kwargs": {
"grant_config": {
"usage_rules": {
"authorization_code": {
"supports_minting": ["access_token", "refresh_token", "id_token"],
"max_usage": 1,
"expires_in": 300
},
"access_token": {
"expires_in": 600,
},
"refresh_token": {
"supports_minting": ["access_token"],
"audience": ["https://example.com", "https://example2.com"],
"expires_in": 43200,
},
},
"expires_in": 43200,
}
},
},
"token_handler_args": {
"code": {
"kwargs": {
"crypt_conf": CRYPT_CONFIG
}
},
"token": {
"class": "idpyoidc.server.token.jwt_token.JWTToken",
"kwargs": {
"add_claims_by_scope": True,
"aud": ["https://example.org/appl"],
},
},
"refresh": {
"class": "idpyoidc.server.token.jwt_token.JWTToken",
"kwargs": {
"aud": ["https://example.org/appl"],
},
},
"id_token": {
"class": "idpyoidc.server.token.id_token.IDToken",
"kwargs": {
"lifetime": 86400,
"add_claims_by_scope": True
},
}
},
"session_params": SESSION_PARAMS,
}