SURFnet / surf-token-based-access

1 stars 1 forks source link

Dynamic client registration #57

Closed michielbdejong closed 4 months ago

michielbdejong commented 4 months ago

I think we need something like https://datatracker.ietf.org/doc/html/rfc7591 I think https://github.com/jasonraimondi/ts-oauth2-server does not support it. I think I'll start with a simple unthrottled open call that allows anyone to add a client. Will discuss decision on if/how/to what extent we want to do this in our PoC with Pieter next week

michielbdejong commented 4 months ago
$ curl -d'name=test' https://sram-auth-poc.pondersource.net/api/register
{"clientId":"6aea0763-525e-4619-b711-02bc78bcab54","clientSecret":"7d970ee4eb1c08f7ee0b71de3c63a7cb8016fff3eceee0a1a314343d13d9679f94fa559529fc80dcc31eadb3d941ded38f715ef7bd90817e120e4597530d1365"}

although it doesn't seem to have been added to the db:

$ psql postgresql://prisma:secret@localhost:8888/prismadb
psql (14.12 (Homebrew), server 16.3 (Debian 16.3-1.pgdg120+1))
WARNING: psql major version 14, server major version 16.
         Some psql features might not work.
Type "help" for help.

prismadb=# select * from "OAuthClient";
select * from "OAuthClient";
                  id                  |      name      | secret |        createdAt        |        updatedAt        |           redirectUris           |                     allowedGrants                     
--------------------------------------+----------------+--------+-------------------------+-------------------------+----------------------------------+-------------------------------------------------------
 0e2ec2df-ee53-4327-a472-9d78c278bdbb | Sample Client  |        | 2024-05-28 13:21:49.546 | 2024-05-28 13:21:49.546 | {http://localhost:5173/callback} | {authorization_code,client_credentials,refresh_token}
 9aeb7ebf-09e9-4e96-88a7-b3cf9f9739a2 | WebDAV Mounter |        | 2024-05-28 13:22:24.078 | 2024-05-28 13:22:24.078 | {http://localhost:8080/callback} | {authorization_code,client_credentials,refresh_token}
(2 rows)

(END)

should investigate why!

michielbdejong commented 4 months ago

Ah wait I was looking on the wrong host. All good.