Refresh Principal Token
Motivation
Refreshes a valid principal token
Functional design
POST /api/v2/apps/{owner}/{app}/auth/refresh
Headers
Content-Type
application/json
Authorization
Bearer {PrincipalToken}
Parameters
owner
string
name of a user who owns the application
app
string
name of an application
Result
200
OK
Returns a refreshed principal token, see below
Example result 200:
{
"principalToken": "abc.def.ghi",
"expiresInSeconds": 3600, // seconds
"profileWSID": 1234567890
}Technical design
Components
pkg/router
URL path handler
~cmp.routerRefreshHandler~✅sends
APIPath_Auth_Refreshrequest to QueryProcessor;
pkg/processors/query2
IApiPathHandlerimplementation for handlingAPIPath_Auth_Refreshin the AppWorkspace~cmp.authRefreshHandler~✅extracts profile WSID from token and makes federation post to refresh token:
sends federation request to refresh token:
~cmp.authRefreshHandler.refreshToken~❓
newQueryProcessorPipeline: provide API handler forAPIPath_Auth_Refresh~cmp.provideAuthRefreshHandler~✅
openapi:
add
/auth/refreshto the list of API paths;~cmp.provideAuthRefreshPath~✅
pkg/sys/it
integration test for /refresh
~it.TestRefresh~✅
Last updated
Was this helpful?