electron-steam-openid

An OpenID module to authenticate to Steam for your Electron app.

Usage no npm install needed!

<script type="module">
  import electronSteamOpenid from 'https://cdn.skypack.dev/electron-steam-openid';
</script>

README

electron-steam-openid Build Status

A library to handle Steam authentication with OpenID, for your Electron app.

Install

$ npm install --save electron-steam-openid

Usage

const electronSteamAuth = require('electron-steam-openid');

var config = {
  redirectUri: 'http://localhost'
};

app.on('ready', () => {
  const windowParams = {
    alwaysOnTop: true,
    autoHideMenuBar: true,
    webPreferences: {
      nodeIntegration: false
    }
  }

  const auth = electronSteamAuth(config, windowParams);

  auth.authenticate(options)
    .then(token => {
      // use your token.steam_id
    });
});

API

electronSteamAuth(config, windowParams)

config

Type: Object Sets custom openid.RelyingParty() params

windowParams

Type: Object

An object that will be used to create the BrowserWindow. Details: Electron BrowserWindow documention

Methods

getAuthorizationCode(options)

Returns a Promise that gets resolved with the authorization details of the OpenID authorization request.

Adapted from

electron-oauth2

License

MIT