mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Refactoring oauth token handling functions and dependants
This commit is contained in:
parent
34edbce1a0
commit
d2ec81b12b
@ -31,7 +31,7 @@ var apiWrapperUtil = function () {
|
|||||||
log.error("Could not set up encoded tenant based client credentials " +
|
log.error("Could not set up encoded tenant based client credentials " +
|
||||||
"to session context. No username is found as input.");
|
"to session context. No username is found as input.");
|
||||||
} else {
|
} else {
|
||||||
var dynamicClientCredentials = tokenUtil.getDyanmicClientCredentials();
|
var dynamicClientCredentials = tokenUtil.getDynamicClientCredentials();
|
||||||
if (!dynamicClientCredentials) {
|
if (!dynamicClientCredentials) {
|
||||||
log.error("Could not set up encoded tenant based client credentials " +
|
log.error("Could not set up encoded tenant based client credentials " +
|
||||||
"to session context as the server is unable to obtain dynamic client credentials.");
|
"to session context as the server is unable to obtain dynamic client credentials.");
|
||||||
|
|||||||
@ -43,7 +43,7 @@ var backendServiceInvoker = function () {
|
|||||||
privateMethods.getAccessToken = function () {
|
privateMethods.getAccessToken = function () {
|
||||||
var tokenPair = parse(session.get(constants["ACCESS_TOKEN_PAIR_IDENTIFIER"]));
|
var tokenPair = parse(session.get(constants["ACCESS_TOKEN_PAIR_IDENTIFIER"]));
|
||||||
if (tokenPair) {
|
if (tokenPair) {
|
||||||
return tokenPair.accessToken;
|
return tokenPair["accessToken"];
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ var util = function () {
|
|||||||
var adminUser = devicemgtProps["adminUser"];
|
var adminUser = devicemgtProps["adminUser"];
|
||||||
var clientName = devicemgtProps["clientName"];
|
var clientName = devicemgtProps["clientName"];
|
||||||
|
|
||||||
module.getDyanmicCredentials = function (owner) {
|
module.getDynamicClientCredentials = function () {
|
||||||
var payload = {
|
var payload = {
|
||||||
"callbackUrl": devicemgtProps.callBackUrl,
|
"callbackUrl": devicemgtProps.callBackUrl,
|
||||||
"clientName": clientName,
|
"clientName": clientName,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user