Comments (8)
what database are you using, and what's the character set encoding on the database?
from django-shibboleth-remoteuser.
We're using PostgreSQL 9.6 and the database character set is UTF-8.
from django-shibboleth-remoteuser.
try adding a logging statement in ShibbolethRemoteUserMiddleware.parse_attributes() and see what values the headers have in Django request.META.
from django-shibboleth-remoteuser.
I added the following statement in ShibbolethRemoteUserMiddleware.parse_attributes()
logger.debug( "%s : %s",name,value)
and I got this output
DEBUG username : [email protected]
DEBUG first_name : Frédéric
DEBUG last_name : Mazzini
DEBUG email : [email protected]
My logging handler is configured like this ;
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': '/tmp/pns.log',
'formatter': 'simple',
'encoding': 'utf8'
}
from django-shibboleth-remoteuser.
Are you on python 2 or 3? If 2, you need to make the log string explicitly unicode, instead of str.
If the data is garbled already in request.META, that's outside this project and we can close this issue. Then there may be an issue with how your webserver or Shibboleth is configured. You might want to make a very basic django project, with no dependencies, and make sure the Shib headers (in request.META) are correct. Then you can build from there.
from django-shibboleth-remoteuser.
I'm on python 3.6 and on django 2.0.7.
If I check the attributes value with the Shibboleth Session Handler they are correctly encoded.
I have the feeling that Django interprets the values with a latin-1 charset. If I replace the statement shib_attrs[name] = value by shib_attrs[name] = bytearray(value, 'latin-1').decode('utf8') I get a correct value.
from django-shibboleth-remoteuser.
Check your django settings (or your environment or webserver locale) for anything that could be set to 'latin-1'. But if the data is garbled in request.META, that's outside this package. I'm going to close this issue.
from django-shibboleth-remoteuser.
ok.
Thanks for your help.
from django-shibboleth-remoteuser.
Related Issues (20)
- In Django 1.6.5 get_fields doesn't exists HOT 3
- How is make_profile rewrite working ? HOT 2
- Remove user session instead of setting LOGOUT_SESSION_KEY on logout? HOT 7
- Shibboleth is sending null values when users are connecting which is redirecting to login page HOT 4
- Shibboleth headers not coming back when redirect URL is set HOT 2
- django-shibboleth-remoteuser won't install to virtual environment HOT 2
- Mock Shibboleth Headers HOT 5
- error with Template tags HOT 3
- install old version HOT 1
- Create a new release tag HOT 1
- Problems with Django 2.1 HOT 1
- Stale request HOT 8
- Unknown AssertionConsumerServiceURL Shibboleth.sso/SAML2/POST HOT 2
- Pass request variable to authentication backend HOT 1
- urllib quote library import is incorrect for python 3 HOT 2
- 0.12 release? HOT 1
- Compatible with SP3, server variables? HOT 2
- shibboleth fields with UTF-8 content end up badly encoded via wsgi
- Stop using "url()" in urls.py from Django 4.x compatibility
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 django-shibboleth-remoteuser.