Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(({jwt}) => {
const guestSpark = new CiscoSpark({
credentials: {
federation: true
}
});
return guestSpark.authorization.requestAccessTokenFromJwt({jwt}).then(() =>
// We don't have a user id for guest users until a record is looked up
guestSpark.people.get('me').then((p) => {
const guestUser = Object.assign({}, p);
// id is hydra from get people, but is expected to be a uuid
const {id} = deconstructHydraId(p.id);
guestUser.id = id;
const email = p.emails[0];
guestUser.email = email;
.then((users) => {
[docbrown] = users;
docbrown.spark = new CiscoSpark({
credentials: {
authorization: docbrown.token,
federation: true
},
config: {
logger: {
level: 'error'
}
}
});
return docbrown.spark.internal.mercury.connect();
}));
.then((users) => {
[docbrown] = users;
docbrown.spark = new CiscoSpark({
credentials: {
authorization: docbrown.token,
federation: true
},
config: {
logger: {
level: 'error'
}
}
});
}));
users = u.map((user) => {
const spark = new CiscoSpark({
credentials: {
authorization: user.token,
federation: true
},
config: {
logger: {
level: 'error'
}
}
});
return Object.assign({}, user, {
spark
});
});
.then((users) => {
[marty] = users;
marty.spark = new CiscoSpark({
credentials: {
authorization: marty.token,
federation: true
},
config: {
logger: {
level: 'error'
}
}
});
return marty.spark.internal.mercury.connect();
}));
componentDidMount() {
this.spark = new Spark({
config: {
credentials: {
oauth: {
client_id: this.props.clientId,
client_secret: this.props.clientSecret,
scope: this.props.scope,
redirect_uri: this.props.redirectUri
}
},
storage: {
boundedAdapter: new LocalStorageStoreAdapter('ciscospark-embedded')
}
}
});
this.spark.listenToAndRun(this.spark, 'change:canAuthorize', () => {
export function createSDKGuestInstance(jwt, options = {}) {
const webexSDKInstance = new Webex({
config: defaultConfig(options)
});
return webexSDKInstance.authorization.requestAccessTokenFromJwt({jwt}).then(() => webexSDKInstance);
}
export function createSDKInstance(accessToken, options = {}) {
const webexSDKInstance = new Webex({
credentials: {
authorization: {
access_token: accessToken
}
},
config: defaultConfig(options)
});
return Promise.resolve(webexSDKInstance);
}