Hey guys,
how can I return the profile parameter in this case ?
because I get an empty object {}
http://passportjs.org/docs/profile
var passport = require('passport')
, OAuth2Strategy = require('passport-oauth').OAuth2Strategy;
passport.use('provider', new OAuth2Strategy({
authorizationURL: 'https://www.provider.com/oauth2/authorize',
tokenURL: 'https://www.provider.com/oauth2/token',
clientID: '123-456-789',
clientSecret: 'shhh-its-a-secret'
callbackURL: 'https://www.example.com/auth/provider/callback'
},
function(accessToken, refreshToken, profile, done) {
User.findOrCreate(..., function(err, user) {
done(err, user);
});
}
));
thank you for your effort.
@rasheedhamdawi I can't found how it is connected with Doorkeeper gem?
@nbulaj I am trying to build an account service like Google Accounts and I am using Doorkeeper with Devise.
I have separate service built with NodeJS and I want to implement the authentication with the Account service.
here is the initializer
Doorkeeper.configure do
orm :active_record
resource_owner_authenticator do |routes|
current_user || warden.authenticate!(:scope => :user)
end
use_refresh_token
force_ssl_in_redirect_uri !Rails.env.development?
grant_flows %w(authorization_code client_credentials)
end
I think you want this
Hi @rasheedhamdawi . If you want to provide more info with the token response, then you need to extend it like @chadwilken said (you need to extend token response like described in the wiki).
Most helpful comment
I think you want this