diff --git a/.changeset/ten-cobras-wash.md b/.changeset/ten-cobras-wash.md new file mode 100644 index 0000000000..81915d958d --- /dev/null +++ b/.changeset/ten-cobras-wash.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend': minor +--- + +Allowed post method on /refresh path diff --git a/docs/auth/add-auth-provider.md b/docs/auth/add-auth-provider.md index eb8973bec1..01c18f04cd 100644 --- a/docs/auth/add-auth-provider.md +++ b/docs/auth/add-auth-provider.md @@ -350,6 +350,7 @@ router.get('/auth/providerA/handler/frame'); router.post('/auth/providerA/handler/frame'); router.post('/auth/providerA/logout'); router.get('/auth/providerA/refresh'); // if supported +router.post('/auth/providerA/refresh'); // if supported ``` As you can see each endpoint is prefixed with both `/auth` and its provider diff --git a/plugins/auth-backend/src/service/router.ts b/plugins/auth-backend/src/service/router.ts index 2232eeaa81..e4fa5eeea4 100644 --- a/plugins/auth-backend/src/service/router.ts +++ b/plugins/auth-backend/src/service/router.ts @@ -140,6 +140,7 @@ export async function createRouter( } if (provider.refresh) { r.get('/refresh', provider.refresh.bind(provider)); + r.post('/refresh', provider.refresh.bind(provider)); } router.use(`/${providerId}`, r);