mcueto / djangorestframework-auth0

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

multiple clients v1 #26

Closed Calion54 closed 7 years ago

Calion54 commented 7 years ago

Hello,

I have succeeded to manage the multiple clients. So, I can manage multiple client id and secret id. So, I have changed the client's settings. This is an example :

AUTH0 = {
    'JWT_AUTH_HEADER_PREFIX': 'Bearer',
    'AUTH0_ALGORITHM': 'HS256',
    'CLIENTS': {
        'web': {
            'AUTH0_CLIENT_ID': 'web-id',
            'AUTH0_CLIENT_SECRET': 'web-secret',
            'CLIENT_SECRET_BASE64_ENCODED': True,
        },
        'android': {
            'AUTH0_CLIENT_ID': 'android-id',
            'AUTH0_CLIENT_SECRET': 'android-secret',
            'CLIENT_SECRET_BASE64_ENCODED': False,
        }
    }
}

In fact, For each request, you should add an header variable "clientcode" wich content the name of client (web, android...)

If my pull request is accepted, could you change the readme ? (my english is very poor...)

mcueto commented 7 years ago

Thank you! i will merge this in the feature/multiple-clients branch and i will figure out how to support both the old style and the new of settings ;)

then i will merge this with development and master 👍

Thanks!!! and nice week for you

Calion54 commented 7 years ago

Hello,

Thank you, it's good. I will continue to improve the system. Such as changing the name of the variable in the header