- Personal Access Tokens (PAT) provide an alternative authentication mechanism from the short lived OAuth token issued when using a username & password.
- The PAT is valid until you regenerate a new token.
- The PAT will expire within 365 days.
- The expiry date is shown once a token is generated.
- PAT uses basic authentication where the username is your Fluid username and the password is the generated token.
To generate and use a token please follow the steps below.
- Go to “Update My Profile” which is on the main menu (Drop down when clicking the Avatar).
- Click “Generate Personal Access Token” (If this button is not visible then please contact Fluid support).
- Copy the newly generated access token by clicking the button “Copy Token”. Store in a safe place as this token will not be available later.
- Use Basic authentication, with your Fluid users username as the username, and the password as the generated token.
Example of what is seen in Power Apps when creating a custom connector.
Example of setting the username and password in PowerApps. (Creating a connection)
- If you are creating your own request manually (with a tool like curl) then you will need to combine your Fluid username with the personal access token and encode to base 64. (Note there must be a colon between the username and token.)
Convert the username and token to base64. (https://www.base64encode.org/)
You can now use the above base64 token with a Api request to your Fluid instance.
- Add an Authorization header to your request which uses the Basic authorization type.
Authorization: Basic “base 64 token”.
E.g. Header example
Authorization: Basic ZGF2aWQuYnVydDpaR0YyYVdRdVluVnlkSHd5TURJd0x6RXhMekEwSURFd09qVTJPak00SUVGTmZEWXdORE15T0RFM05nPT0=
- Example of a curl request.
curl -X GET -H "Authorization: Basic ZGF2aWQuYnVydDpaR0YyYVdRdVluVnlkSHd5TURJd0x6RXhMekEwSURFd09qVTJPak00SUVGTmZEWXdORE15T0RFM05nPT0=" https://domain.fluid.work/api/Account/MyProfile