Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@broadly/passport-canvas-app
Advanced tools
Readme
In order to use this Strategy, you'll need a Connected App with Force.com Canvas
enabled, Canvas App URL
that points to the authenticate endpoint, and Access Method
set to Signed Request (POST)
.
npm install --save @broadly/passport-canvas-app
Create a strategy using the connected app consumer secret:
const strategy = new Strategy({
consumerSecret: '....'
}, function verifyUser(token, profile, done) {
console.log(profile);
return done(null, profile);
});
You will need to authenticate the canvas app endpoint, responding to POST (not GET) request:
app.post('/',
passport.authenticate('canvas-app'),
function canvasAppPage(req, res) {
res.render('index', {
parameters: req.body.parameters,
record: req.body.record,
user: req.user
});
}
)
If you are using sessions, don't forget to limit the session duration, and to reject unauthenticated requests on all other routes/methods.
app.use(function requireAuthentication(req, res, next) {
if (req.isAuthenticated())
next();
else
res.sendStatus(403);
});
The user profile is available from req.user
:
req.user
=> {
id: 'https://login.salesforce.com/id/00Dx00000001hxyEAA/005x0000001SyyEAAS',
organization_id: '00Dx00000001hxyEAA',
user_id: '005x0000001SyyEAAS',
display_name: 'Sean Forbes',
email: 'admin@6457617734813492.com'
}
If the apex:canvasApp
component specifies any parameters, these parameters are available from req.body.parameters
:
<apex:canvasApp parameters="{count: 2}" ... />
req.body.parameters
=> {
count: 2
}
If the canvas app appears in association with an object, information about that object, and its fields, are available from req.body.record
:
req.body.record
=> {
attributes: {
type: 'Account',
url: '/services/data/v36.0/sobjects/Account/001xx000003DGWiAAO'
},
Id: '001xx000003DGWiAAO',
Phone: '(555) 555-5555',
Fax: '(555) 555-5555',
BillingCity: 'Seattle'
}
FAQs
Passport.js authentication strategy for Salesforce Canvas App (POST signed requests)
The npm package @broadly/passport-canvas-app receives a total of 0 weekly downloads. As such, @broadly/passport-canvas-app popularity was classified as not popular.
We found that @broadly/passport-canvas-app demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.