GithubHelp home page GithubHelp logo

kharalampidi / meteor-accounts-steam Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scholtzm/meteor-accounts-steam

0.0 2.0 0.0 5 KB

Steam OpenID integration for Meteor Accounts

License: MIT License

JavaScript 100.00%

meteor-accounts-steam's Introduction

Steam OpenID integration for Meteor Accounts

Atmosphere is filled with over dozen Steam packages which provide this functionality, however most of these packages are either outdated or lack even the basic description, such as a README file.

Installation

meteor add scholtzm:accounts-steam

Usage

Meteor.loginWithSteam(options, callback)

  • options - object containing options, see below (optional)
  • callback - callback function (optional)
    • error - Meteor.Error object if error occured; null otherwise

Note: callback will be only called if loginStyle is set to popup

Example

Template.myTemplateName.events({
  'click #login-button': function() {
    Meteor.loginWithSteam();
  }
);

Options

These options override service configuration stored in the database.

  • loginStyle - redirect or popup
  • redirectUrl - where to redirect after successful login

Note: redirectUrl will be used only if loginStyle is set to redirect

The value below can be only set via Accounts UI dialog or by inserting the service configuration directly to database:

  • timeout - timeout value (in milliseconds) for the OpenID handshake

Accounts UI integration

This package integrates with accounts-ui and also provides configuration dialog. The configuration dialog contains field Timeout, which can be used to adjust timeout value (in milliseconds) for the OpenID handshake.

You can also skip the config dialog by running a short snippet in your Meteor.startup function, see below.

Manual configuration setup

You can manually configure this package by upserting the service configuration on startup. First, add the service configuration package:

meteor add service-configuration

Then in your project:

if(Meteor.isServer) {
  Meteor.startup(function () {
    ServiceConfiguration.configurations.upsert(
      { service: 'steam' },
      {
        $set: {
          loginStyle: 'redirect',
          timeout: 10000 // 10 seconds
        }
      }
    );
  });
}

You will most likely want to do this to have your Steam login service always configured.

Fetching user's profile

This package does not require your Steam API key, because the only information it provides is user's 64 bit Steam ID.

Retrieving user's profile information such as display name or avatar is up to you.

Ideally, you should at least retrieve user's profile information when he logs in for the very first time. This can be accomplished by utilizing Accounts.onCreateUser (server-side).

If you wish to keep user's profile up-to-date, you can use Accounts.onLogin (server-side) or different approach.

LICENSE

MIT. See LICENSE.

meteor-accounts-steam's People

Contributors

scholtzm avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.