Skip to content

Commit c22eac0

Browse files
committed
feat(doChallenge) doLoginWithChallengeToken
1 parent 18cea6d commit c22eac0

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

coreBOSAPI.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,27 @@ angular.module('coreBOSAPIservice', [])
127127
}
128128
};
129129

130+
/**
131+
* Do Login Operation with a given challenge token
132+
*/
133+
corebosAPI.doLoginWithChallengeToken = function(username, accesskey, withpassword, chtoken) {
134+
if (username==undefined) username = corebosAPI.getcoreBOSUser();
135+
if (accesskey==undefined) accesskey = corebosAPI.getcoreBOSKey();
136+
if (withpassword==undefined) withpassword = false;
137+
corebosAPI.setcoreBOSUser(username);
138+
corebosAPI.setcoreBOSKey(accesskey);
139+
var postdata = {
140+
'operation' : 'login',
141+
'username' : username,
142+
'accessKey' : (withpassword ? chtoken + accesskey : md5.createHash(chtoken + accesskey))
143+
};
144+
return $http({
145+
method : 'POST',
146+
url : _serviceurl,
147+
data: postdata
148+
});
149+
};
150+
130151
/**
131152
* Do Login Operation
132153
*/

0 commit comments

Comments
 (0)