Exemplo n.º 1
0
    def post(self):
        token = self.get_argument("access_token")
        access_token = AccessToken(self.application.access_token_store).find_by_access_token(token)
        data = access_token.verify()

        self.set_header("Content-Type", "application/json")
        self.write(json.dumps(data))
Exemplo n.º 2
0
    def test_verify(self):
        user_id = '1'
        access_token = AccessToken(self.access_token_store, user_id=user_id)
        access_token.save()

        fetched_data = access_token.verify()

        assert fetched_data['client_id'] == user_id
        assert 0 <= fetched_data['expires_in'] <= 3600