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

OAUTH: how can an atproto PDS do discovery for the localhost "global client ID"? #52

Open
sandhose opened this issue Feb 8, 2024 · 1 comment

Comments

@sandhose
Copy link

sandhose commented Feb 8, 2024

The proposal says:

Domain names used as client IDs **must** have a suffix registered in the [Public Suffix List][PSL]. The only exception to this rule is `localhost`, which **must** be used for local development only.

However, I don't see how localhost could be used for local development? This implies the PDS and the client runs on the same host, and that the client somehow listens with HTTPS on port 443, which usually requires root privileges to do

@sandhose sandhose changed the title OAUTH: how can an atproto PDS do discovery for the localhost "client ID"? OAUTH: how can an atproto PDS do discovery for the localhost "global client ID"? Feb 8, 2024
@matthieusieben
Copy link
Contributor

matthieusieben commented Feb 14, 2024

When using localhost as client id, the metadata that will be used by the oauth provider will be an hard coded value (and never be fetched directly by the AS):

#### Client metadata for local development
When using `localhost` as client ID, the AS will not be able to resolve the client metadata using the method described above. Instead, the Authorization Server will use the following client metadata:
```json
{
"client_id": "localhost",
"client_name": "Native atproto client",
"client_uri": "http://localhost/",
"scope": "profile offline_access",
"response_types": ["code", "code id_token"],
"grant_types": ["authorization_code", "refresh_token"],
"redirect_uris": ["http://127.0.0.1/", "http://[::1]/"],
"token_endpoint_auth_method": "none",
"application_type": "native",
"dpop_bound_access_tokens": true
}
```

The port number of the redirect_uri will be ignored, allowing the dev server to run on any port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants