This commit is contained in:
@@ -5,6 +5,7 @@ var clientId;
|
|||||||
var realm;
|
var realm;
|
||||||
var oauth2KeyName;
|
var oauth2KeyName;
|
||||||
var redirect_uri;
|
var redirect_uri;
|
||||||
|
var clientSecret;
|
||||||
|
|
||||||
function handleLogin() {
|
function handleLogin() {
|
||||||
var scopes = [];
|
var scopes = [];
|
||||||
@@ -184,6 +185,7 @@ function initOAuth(opts) {
|
|||||||
popupMask = (o.popupMask||$('#api-common-mask'));
|
popupMask = (o.popupMask||$('#api-common-mask'));
|
||||||
popupDialog = (o.popupDialog||$('.api-popup-dialog'));
|
popupDialog = (o.popupDialog||$('.api-popup-dialog'));
|
||||||
clientId = (o.clientId||errors.push('missing client id'));
|
clientId = (o.clientId||errors.push('missing client id'));
|
||||||
|
clientSecret = (o.clientSecret||errors.push('missing client secret'));
|
||||||
realm = (o.realm||errors.push('missing realm'));
|
realm = (o.realm||errors.push('missing realm'));
|
||||||
|
|
||||||
if(errors.length > 0){
|
if(errors.length > 0){
|
||||||
@@ -206,6 +208,7 @@ function initOAuth(opts) {
|
|||||||
window.processOAuthCode = function processOAuthCode(data) {
|
window.processOAuthCode = function processOAuthCode(data) {
|
||||||
var params = {
|
var params = {
|
||||||
'client_id': clientId,
|
'client_id': clientId,
|
||||||
|
'client_secret': clientSecret,
|
||||||
'code': data.code,
|
'code': data.code,
|
||||||
'grant_type': 'authorization_code',
|
'grant_type': 'authorization_code',
|
||||||
'redirect_uri': redirect_uri
|
'redirect_uri': redirect_uri
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
if(typeof initOAuth == "function") {
|
if(typeof initOAuth == "function") {
|
||||||
initOAuth({
|
initOAuth({
|
||||||
clientId: "your-client-id",
|
clientId: "your-client-id",
|
||||||
|
clientSecret: "your-client-secret",
|
||||||
realm: "your-realms",
|
realm: "your-realms",
|
||||||
appName: "your-app-name"
|
appName: "your-app-name"
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user