Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension to Allow Clients to Get Tokens Secured by Ticket #88

Open
dshanske opened this issue Aug 18, 2021 · 5 comments
Open

Extension to Allow Clients to Get Tokens Secured by Ticket #88

dshanske opened this issue Aug 18, 2021 · 5 comments
Labels
ticketing extension Ticketing for IndieAuth extension

Comments

@dshanske
Copy link
Member

dshanske commented Aug 18, 2021

Want to start discussing this.

Proposing a simplified way for a client to get access to the token secured by the ticket endpoint. Starting with the autoauth solution, suggest that the client, in a user initiated interaction, needs to secure a token with a scope that gives it permission to retrieve tokens, let's say scope 'external_token'. We already have a flow for this, so no changes are required.

So, using the example of a social reader application, when you configure it, you grant it, or don't grant it permission to retrieve external tokens.

Then, the client would use that token, with the scope, to request it be given a copy of the stored token. That would likely be at the token endpoint for the user they are obtaining it on behalf of, with a new grant_type, providing the token that authorizes them to get these tokens, the client_id of the client requesting it, and the resource the URL the token allows access for.

Just started thinking about this, so a bit rough.

@dshanske dshanske added the ticketing extension Ticketing for IndieAuth extension label Aug 18, 2021
@dshanske
Copy link
Member Author

@Zegnat commented that overloading the token endpoint might not be the best idea, and having a query to the ticket endpoint with the previously mentioned bearer token might be better

@dshanske
Copy link
Member Author

dshanske commented Aug 29, 2021

If we end up querying the ticket endpoint, then it would have to be another POST request, with a bearer token with the 'external_token' scope in the Authorization header, with the resource URL, and it would either return the access token it previously got or error.

Or alternatively, to match the syntax of token introspection, it could be a POST request with the token supporting the external_token scope in the body instead? For example, token=xxxxxx&resource=https://example.com with the response format being equivalent to the IndieAuth access token response, with the added elements of resource

@dshanske
Copy link
Member Author

Actually, looking, token introspection uses aud, not resource. Too many changing parameter names.

@dshanske
Copy link
Member Author

By using the token introspection language, we mirror what we're introducing into the token endpoint, and it ends up being a similar flow to implement. But, debating the POST formatting. Which makes more sense?

  1. POST with token as a parameter, similar to the format of introspection? In introspection, the token parameter is the one you want info about. In this, it would be the one you are using as authorization to get a token. So maybe not.
  2. POST with the token in the Authorization header? This is more consistent with an authenticated request, except that would mean the only parameter would be resource. And in that case, we have the issue of the ticket send flow being a POST request using 'ticket', 'resource', 'subject'? Would there be an issue with this just having resource?

Also, looking at the discussion on the refresh_token flow, @aaronpk pointed out that client_id is a mandatory parameter in that flow, even though it should be associated with the token already, for various reasons. So that would suggest in this context, subject should be a mandatory parameter. Client_id probably should as well, because the client would be issued a token giving it scope to request these tokens stored in the ticket endpoint.

Decisions, decisions...

@dshanske
Copy link
Member Author

dshanske commented Oct 2, 2021

Wonder if the flow for getting an introspection token #99 should match the proposed flow for getting a token to retrieve external tokens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ticketing extension Ticketing for IndieAuth extension
Development

No branches or pull requests

1 participant