Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update strategy.js to remote some github references #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions lib/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,28 @@ var util = require('util')
/**
* `Strategy` constructor.
*
* The GitHub authentication strategy authenticates requests by delegating to
* GitHub using the OAuth 2.0 protocol.
* The Onshape authentication strategy authenticates requests by delegating to
* Onshape using the OAuth 2.0 protocol.
*
* Applications must supply a `verify` callback which accepts an `accessToken`,
* `refreshToken` and service-specific `profile`, and then calls the `done`
* callback supplying a `user`, which should be set to `false` if the
* credentials are not valid. If an exception occured, `err` should be set.
*
* Options:
* - `clientID` your GitHub application's Client ID
* - `clientSecret` your GitHub application's Client Secret
* - `callbackURL` URL to which GitHub will redirect the user after granting authorization
* - `clientID` your Onshape application's Client ID
* - `clientSecret` your Onshape application's Client Secret
* - `callbackURL` URL to which Onshape will redirect the user after granting authorization
* - `scope` array of permission scopes to request. valid scopes include:
* 'user', 'public_repo', 'repo', 'gist', or none.
* (see http://developer.github.com/v3/oauth/#scopes for more info)
* — `userAgent` All API requests MUST include a valid User Agent string.
* e.g: domain name of your application.
* (see http://developer.github.com/v3/#user-agent-required for more info)
* 'OAuth2Read', 'OAuth2ReadPII', 'OAuth2Write', 'OAuth2Delete', or 'OAuth2Purchase'.
* (see https://github.com/onshape-public/apikey#scopes for more info)
*
* Examples:
*
* passport.use(new GitHubStrategy({
* passport.use(new OnshapeStrategy({
* clientID: '123-456-789',
* clientSecret: 'shhh-its-a-secret'
* callbackURL: 'https://www.example.net/auth/github/callback',
* userAgent: 'myapp.com'
* },
* function(accessToken, refreshToken, profile, done) {
* User.findOrCreate(..., function (err, user) {
Expand Down Expand Up @@ -237,11 +233,11 @@ Strategy.prototype.authorizationParams = function(req, options) {
};

/**
* Retrieve user profile from GitHub.
* Retrieve user profile from Onshape.
*
* This function constructs a normalized profile, with the following properties:
*
* - `provider` always set to `github`
* - `provider` always set to `onshape`
* - `id` the user's GitHub ID
* - `username` the user's GitHub username
* - `displayName` the user's full name
Expand Down