I do not know the general oauth package. But writing a package for your specific server is not so difficult, as there are several examples to watch.
As an example, you can use account-github, here is the code to connect to the client. Pay attention to the endpoint URL, client ID, scope, etc. This will handle the popup for you, but you probably want to include your own CSS:
var loginUrl = 'https://github.com/login/oauth/authorize' + '?client_id=' + config.clientId + '&scope=' + flatScope + '&redirect_uri=' + OAuth._redirectUri('github', config) + '&state=' + OAuth._stateParam(loginStyle, credentialToken); OAuth.launchLogin({ loginService: "github", loginStyle: loginStyle, loginUrl: loginUrl, credentialRequestCompleteCallback: credentialRequestCompleteCallback, credentialToken: credentialToken, popupOptions: {width: 900, height: 450} });
And here is a fragment from server , completing the process of obtaining an access token:
var getAccessToken = function (query) { var config = ServiceConfiguration.configurations.findOne({service: 'github'}); if (!config) throw new ServiceConfiguration.ConfigError(); var response; try { response = HTTP.post( "https://github.com/login/oauth/access_token", { headers: { Accept: 'application/json', "User-Agent": userAgent }, params: { code: query.code, client_id: config.clientId, client_secret: OAuth.openSecret(config.secret), redirect_uri: OAuth._redirectUri('github', config), state: query.state } }); } catch (err) { throw _.extend(new Error("Failed to complete OAuth handshake with Github. " + err.message), {response: err.response}); } if (response.data.error) {
And using the token to get the user id:
var getIdentity = function (accessToken) { try { return HTTP.get( "https://api.github.com/user", { headers: {"User-Agent": userAgent},
github and accounts-github packages should be very useful as links.