UserAuthConfig
Properties
Optional expires In
The maximum validity of the token in seconds.
It must be equal or greater than zero. This value will be ignored if it is zero or greater than the maximum expiration defined by the application which is usually 24h.
Optional scope
Project scope.
If the project is specified, the resulting token is bound to it. If the desired resource is restricted to a specific project, to get a valid token, specify this project.
token Requester
Gets the access token.
You can provide your own implementation or use one from @here/olp-sdk-authentication.
There are two functions that work for the browser and Node.js. For the browser, UserAuth uses requestToken() from requestToken.web.ts. For Node.js,UserAuth uses requestToken() from requestToken.ts.
When a function imports a function using import { requestToken } from "@here/olp-sdk-authentication"`, the code automatically applies to the corresponding function.
The following code is applicable only for Node.js.
example
import { UserAuth, requestToken } from "@here/olp-sdk-authentication";
const userAuth = new UserAuth({
credentials: {
accessKeyId: "your-access-key",
accessKeySecret: "your-access-key-secret"
},
tokenRequester: requestToken
});
Parameters for authentification.