Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / oa2 / settings.py @ b806a15a

History | View | Annotate | Download (967 Bytes)

1
from django.conf import settings
2

    
3

    
4
def get_setting(key, default):
5
    return getattr(settings, 'OAUTH2_%s' % key, default)
6

    
7
USER_MODEL = get_setting('USER_MODEL', 'auth.User')
8

    
9
ENDPOINT_PREFIX = get_setting('ENDPOINT_PREFIX', 'oauth2/')
10

    
11
TOKEN_ENDPOINT = get_setting('TOKEN_ENDPOINT', 'token/')
12

    
13
AUTHORIZATION_ENDPOINT = get_setting('AUTHORIZATION_ENDPOINT', 'auth/')
14

    
15
# Set the length of newly created authorization codes to 60 characters
16
AUTHORIZATION_CODE_LENGTH = get_setting('AUTHORIZATION_CODE_LENGTH', 60)
17

    
18
# Set the length of newly created access tokens to 30 characters
19
TOKEN_LENGTH = get_setting('TOKEN_LENGTH', 30)
20

    
21
# Set the expiration time of newly created access tokens to 20 seconds
22
TOKEN_EXPIRES = get_setting('TOKEN_EXPIRES', 20)
23

    
24
# Set the maximum allowed redirection endpoint URI length
25
# Requests for a greater redirection endpoint URI will fail.
26
MAXIMUM_ALLOWED_REDIRECT_URI_LENGTH = get_setting(
27
    'MAXIMUM_ALLOWED_REDIRECT_URI_LENGTH', 5000)