Comments (3)
yes
at time of the development of this toolchain the cie specifications was in progress, and the feature you have described is something that was defined later on
I'll keep this for the next milestones, thx
from spid-cie-oidc-django.
Thanks for the response. Until then I've got around with a quick&dirty implementation which maybe can help others
for scope in (
token.session.authz_request.get(
"scope", ""
).split()
):
if scope == 'profile':
jwt['name'] = token.session.user.attributes['username']
jwt['given_name'] = token.session.user.attributes['given_name']
jwt['family_name'] = token.session.user.attributes['family_name']
jwt['birthdate'] = token.session.user.attributes['birthdate']
jwt['https://attributes.eid.gov.it/fiscal_number'] = token.session.user.attributes['https://attributes.eid.gov.it/fiscal_number']
if scope == 'email':
jwt['email'] = token.session.user.attributes['email']
jwt['email_verified'] = token.session.user.attributes['email_verified']
from spid-cie-oidc-django.
please do that in a PR and I'll review, approve and we'll have a new release together
in a settings.py like this https://github.com/italia/spid-cie-oidc-django/blob/main/spid_cie_oidc/provider/settings.py
create a mapping of the scopes2claims
OIDC_SCOPES_CLAIMS_MAP = {
"profile": ["username", "given_name", "family_name", "birthdate", "https://attributes.eid.gov.it/fiscal_number"],
"email": ["email", "email_verified"]
}
then in the code do something like this
for scope in token.session.authz_request.get("scope", "").split():
_user_attrs = token.session.user.attributes
for i in OIDC_SCOPES_CLAIMS_MAP.get(scope, []):
jwt[i] = _user_attrs.get(settings.OIDCFED_PROVIDER_ATTRIBUTES_MAP[i][0])
try to use the local app settings defaults (overloadable also in the settings project) to reduce the constants in the code
from spid-cie-oidc-django.
Related Issues (20)
- Docker compose broken? HOT 3
- Max length for db fields too small - 2048 HOT 2
- Default "cie provider" looks like a spid provider HOT 2
- Userinfo response content-type for spid is wrong HOT 2
- would it be possible to have a "simplified" documentation? HOT 2
- UserInfo does not check for declared key usage when selecting encryption key HOT 2
- Example Cie provider has the same org name as spid provider HOT 1
- CORS support for logos? HOT 1
- Provider login/consent views do not read client_name correctly HOT 1
- Reason behind upper version bounds? HOT 5
- Errore python3 manage.py HOT 1
- constraints in metadata_policy HOT 6
- Schema for authn_request ui_locales is not correct
- Does spid-cie-oidc-django support Attribute Authority flows? HOT 1
- Error in trust chain if docker images are built locally HOT 2
- Resolve endpoint returns non-compliant trust_chain HOT 1
- Trust mark validation endpoint issues HOT 4
- Resolve endpoint returns incomplete trust_chain HOT 3
- Generated trust mark verification problem HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spid-cie-oidc-django.