0.0.1
A Deno package to orchestrate OpenID authentication flow with Steam.
Attributes
Includes Deno configuration
Repository
Current version released
2 years ago
Versions
deno-steam-openid
A Deno package to orchestrate OpenID authentication flow with Steam.
Borrows from node-openid and node-steam-openid with modifications to support the Deno runtime. Note: not all OpenID functionality is supported; only authentication logic required to support flow with Steam.
Usage
OpenID flow confirmed to work with these frameworks:
import { SteamAuth } from 'https://deno.land/x/deno-steam-openid/mod.ts';
// Initialize
const steam = new SteamAuth({
realm: Deno.env.get('DOMAIN'),
returnUrl: `${Deno.env.get('DOMAIN')}/auth`,
apiKey: Deno.env.get('API_KEY'),
});
// Redirect to Steam
const handler = async () {
const redirectUrl = await steam.getRedirectUrl();
}
// Handle redirect from Steam
const otherHandler = async (request) {
const user = await steam.authenticate(request);
}
Example
There’s a simple Oak example in the example directory that demonstrates the flow. This assumes you have the latest version of Deno installed.
- Get a Steam API key
- Run
cp .env.example .env
- Replace
xxxxx
in new.env
file with your API key - Run
deno task example
- Open localhost:8000 and log in to Steam to be redirected to a page with your user information
Test
deno task test
Format
deno task fmt