Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Long running refresh tokens #117

Closed
wants to merge 7 commits into from

Conversation

ticosax
Copy link
Contributor

@ticosax ticosax commented May 8, 2015

this is an attempt to resume work started in #94

@fxdgear It is mostly your work here.

@ticosax
Copy link
Contributor Author

ticosax commented May 8, 2015

needs #118 to be merged first.
Then I'll rebase it.

@fxdgear
Copy link

fxdgear commented May 8, 2015

@ticosax thanks for taking this over. I got really busy with work and haven't had a chance to pick this back up.

@ticosax
Copy link
Contributor Author

ticosax commented May 8, 2015

@fxdgear thank you for the implementation ! 😄

@ticosax
Copy link
Contributor Author

ticosax commented May 13, 2015

@fxdgear please can you tell me what is the reasoning behind the unicity of app field ?

class RefreshToken(models.Model):
   app = models.CharField(max_length=255, unique=True)

I think it should be:

class RefreshToken(models.Model):
    class Meta:
        unique_together = ('user', 'app')

instead.

@fxdgear
Copy link

fxdgear commented May 13, 2015

@ticosax oh you're right. It should be unique_together

@ticosax
Copy link
Contributor Author

ticosax commented May 15, 2015

@fxdgear Thank you for your answer. I updated the PR to reflect the change

@fxdgear
Copy link

fxdgear commented May 15, 2015

👍

@ticosax
Copy link
Contributor Author

ticosax commented May 19, 2015

I will rebase now #118 is merged

fxdgear and others added 4 commits May 19, 2015 09:18
This allows for a client to request refresh tokens. These refresh tokens do not expire.
They can be revoked (deleted). When a JWT has expired, it's possible to send a request
with the refresh token in the header, and get back a new JWT. This allows for the client
to not have to store username/passwords. So, if the client gets a responce about an expired token
the client can automatically make a call (behind the scenes) to delegate a new JWT using
the stored refresh token. Thus keeping the 'session' active.

moving everything to it's own sub dir, so that the refresh token functionality can be optionally installed.
and choose constraint for user and app together
@ticosax ticosax force-pushed the long_running_refresh_tokens branch from 63a70fc to f498cf0 Compare May 19, 2015 07:19
The delegation endpoint
is a `POST`, with the following body.

```json
{
  "client_id":       "YOUR_CLIENT_ID",
  "grant_type":      "urn:ietf:params:oauth:grant-type:jwt-bearer",
  "refresh_token":   "your_refresh_token",
  "api_type":        "app"
}
```
@ticosax
Copy link
Contributor Author

ticosax commented May 20, 2015

will come back in a better shape

@ticosax ticosax closed this May 20, 2015
@ticosax ticosax mentioned this pull request May 26, 2015
1 task
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants