diff options
author | Hong Minhee <minhee@dahlia.kr> | 2013-05-24 22:28:32 +0900 |
---|---|---|
committer | Hong Minhee <minhee@dahlia.kr> | 2013-05-24 22:28:32 +0900 |
commit | 14fffb8dc1c6a3fabf35bc74c3032abcae402a67 (patch) | |
tree | 30f0a32a29ee5b8239a94e71db9ba4481e0f1416 /oauthlib/oauth2 | |
parent | 28f1d3bb1a406b3f45f6cf2f1ccce96e2b31c489 (diff) | |
download | oauthlib-14fffb8dc1c6a3fabf35bc74c3032abcae402a67.tar.gz |
Add optional expires_in parameter to BearerToken
The expires_in is still 3600 by default.
Diffstat (limited to 'oauthlib/oauth2')
-rw-r--r-- | oauthlib/oauth2/draft25/tokens.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/oauthlib/oauth2/draft25/tokens.py b/oauthlib/oauth2/draft25/tokens.py index 1cfc29e..bd937c0 100644 --- a/oauthlib/oauth2/draft25/tokens.py +++ b/oauthlib/oauth2/draft25/tokens.py @@ -172,13 +172,11 @@ class TokenBase(object): class BearerToken(TokenBase): - def __init__(self, request_validator=None, token_generator=None): + def __init__(self, request_validator=None, token_generator=None, + expires_in=3600): self.request_validator = request_validator self.token_generator = token_generator or random_token_generator - - @property - def expires_in(self): - return 3600 + self.expires_in = expires_in def create_token(self, request, refresh_token=False): """Create a BearerToken, by default without refresh token.""" |