Contract for authorization callback function
A callback function which can be implemented by an application to provide an authorization token. Such a function receives a single parameter which is a connection URL and must return a promise which will be resolved to Access Token Response
when authorization token is obtained.
... var viewer = new sap.ui.vk.Viewer(); viewer.setAuthorizationHandler(function(url) { var headers = new Headers(); headers.append("Content-Type", "application/x-www-form-urlencoded"); headers.append("Authorization", "Basic " + basicAuth); return fetch(accessTokenUrl, { method: "POST", body: "grant_type=client_credentials", headers: headers }).then(response => response.json()) }); ...
Event | Description |
---|