I'm trying to integrate login using Snapchat to my application. In order to do that I need to add an authorization bearer to the callback request to my application so I can verify the client. According to Snapchat guide I need to use _qs or Axios to create the request:
// ******************** URL Builder Helper ***********************
var _qs = require("qs"); // Will need to 'npm install qs'
var getAuthCodeRedirectURL = function getAuthCodeRedirectURL(
clientId,
redirectUri,
scopeList,
state
) {
var SNAP_ACCOUNTS_LOGIN_URL =
"https://accounts.snapchat.com/accounts/oauth2/auth";
var scope = scopeList.join(" ");
var loginQS = {
client_id: clientId,
redirect_uri: redirectUri,
response_type: "code",
scope: scope,
state: state,
};
var stringifyLoginQS = _qs.stringify(loginQS);
return SNAP_ACCOUNTS_LOGIN_URL + "?" + stringifyLoginQS;
};
However I'm not sure how I can include the link in the passport.js strategy.
Can you clarify on how it works?