mcueto / djangorestframework-auth0

Library to simply use Auth0 token authentication in DRF within djangorestframework-jwt
MIT License
91 stars 19 forks source link

default client code #28

Closed Calion54 closed 7 years ago

Calion54 commented 7 years ago

Hin @mcueto,

I add the default client code (Web) and you can custom this field in the settings (CLIENT: "toto") So, I think that everything is there to put on the Master.

mcueto commented 7 years ago

I'll do some changes and tomorrow i'll create a pull request to discuss with you those changes before merge to master (i think that there is no need to add a custom default client 'CLIENT': 'Web',, with a Client named default is enough, IMHO) Example of DATABASES settings in django DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } }

THANK YOU!!!!

mcueto commented 7 years ago

Hi @Calion54, i deleted the CLIENT parameter and setted default as name for the default client. so the setting for a single web auth0 app, would be like

AUTH0 = {
    'CLIENTS': {
        'default': {
            'AUTH0_CLIENT_ID': 'client_id',  #make sure it's the same string that aud attribute in your payload provides
            'AUTH0_CLIENT_SECRET': 'c2VjcmV0',
            'CLIENT_SECRET_BASE64_ENCODED': True,
        }
    },
    'AUTH0_ALGORITHM': 'HS256',  # default used in Auth0 apps
    'JWT_AUTH_HEADER_PREFIX': 'JWT',  # default prefix used by djangorestframework_jwt
    'AUTHORIZATION_EXTENSION': False,  # default to False
}

please tell me what you think! i'm updating the readme.md file also

Calion54 commented 7 years ago

Hi @mcueto,

I understand now what you want. Yes, I think that a good idea to purpose a default client. For me, it's OK ! :)