FACEIT (OAuth2) authentication strategies for Passport.

Overview

passport-faceit

FACEIT is a trademark or registered trademark of FACEIT LIMITED in the U.S. and/or other countries. "@ambergg/passport-faceit" is not operated by, sponsored by, or affiliated with FACEIT LIMITED in any way.

Passport strategies for authenticating with FACEIT using OAuth 2.0.

This module lets you authenticate using FACEIT in your Node.js applications. By plugging into Passport, FACEIT authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.

Install

$ npm install @ambergg/passport-faceit

Usage of OAuth 2.0

Configure Strategy

The FACEIT OAuth 2.0 authentication strategy authenticates users using a FACEIT account and OAuth 2.0 tokens. The strategy requires a verify callback, which accepts these credentials and calls done providing a user, as well as options specifying a client ID, client secret, and callback URL.

import passport from "passport";
import jwt from "jsonwebtoken";
import faceitStrategy from "@amber/passport-faceit";

/* Supported scopes: email, membership, openid, profile */
const scopes = "openid, email, profile";

passport.use(new faceitStrategy({
    authorizationURL: FACEIT_AUTHORIZATION_ENDPOINT,
    tokenURL: FACEIT_TOKEN_ENDPOINT,
    callbackURL: YOUR_CALLBACK_URL,
    clientID: FACEIT_CLIENT_ID,
    clientSecret: FACEIT_CLIENT_SECRET,
    scope: scopes,
    scopeSepartor: ',',
    customHeaders: {
      "Authorization": "Basic ${Buffer.from(
        faceitConfig.oauthClientId + ":" + faceitConfig.oauthClientSecret
      ).toString("base64")}",
      "Content-Type": "application/x-www-form-urlencoded"
    }
  },
  (accessToken, refreshToken, params, profile, done) => {
    const userData = jwt.decode(params.id_token);
    done(null, {
        /* Handle the user data as you wish
        * ...
        */
    });
  }
));

Faceit Documentation

License

The MIT License (MIT)

Copyright (c) 2022 Amber.gg

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You might also like...

Error and Success Handler for Passport.js

Error and Success Handler for Passport.js

passport-handler Developed with ❤️ by Swôth 🔎 Installation npm i passport-handler --save yarn add passport-handler 🔮 Importing import Handler from '

Oct 29, 2022

Passport NFT using on-chain metadata

Passport NFT Collection Setup yarn Environment File (.env) RINKEBY_URL: Ethereum (Rinkeby) Testnet Provider endpoint MATIC_URL: Polygon (Matic Mumbai)

Jun 2, 2022

👽 This is a tutorial for integrating Casbin and Passport.

👽 This is a tutorial for integrating Casbin and Passport.

passport-combine-casbin but not only casbin passport-combine-casbin-react:前端应用(vite + react 17): 跳转链接 技术选型 基础:Midway.js ✅ ORM: prisma ✅ DB: mongoDB(需要

Nov 22, 2022

We are creating a Library that would ensure developers do not reinvent the wheel anymore as far as Authentication is concerned. Developers can easily register and download authentication codes that suits their need at any point.

We are creating a Library that would ensure developers do not reinvent the wheel anymore as far as Authentication is concerned. Developers can easily register and download authentication codes that suits their need at any point.

#AuthWiki Resource Product Documentation Figma Database Schema First Presentation Live Link API Documentation Individual Contributions User Activity U

Dec 2, 2022

Example project implementing authentication, authorization, and routing with Next.js and Supabase

Example project implementing authentication, authorization, and routing with Next.js and Supabase

Magic Link Authentication and Route Controls with Supabase and Next.js To run this project, To get started with this project, first create a new proje

Dec 11, 2022

Role based authentication for NodeJS and ExpressJS

Role based authentication Authentication service made for ExpressJS and MongoDB using JWT. We tried to make it as clean and structured as possible. We

Oct 3, 2021

Chrome extension that uses vulnerabilities CVE-2021-33044 and CVE-2021-33045 to log in to Dahua cameras without authentication.

Chrome extension that uses vulnerabilities CVE-2021-33044 and CVE-2021-33045 to log in to Dahua cameras without authentication.

DahuaLoginBypass Chrome extension that uses vulnerability CVE-2021-33044 to log in to Dahua IP cameras and VTH/VTO (video intercom) devices without au

Nov 26, 2022

Twitter RSS (.xml) Feed Scraper Without Developer Authentication

Twitter RSS (.xml) Feed Scraper Without Developer Authentication

Twitter RSS Feed Scraper Without Authentication Command-line application using Node.js that scrapes XML feeds from Nitter, the free and open source al

Jun 15, 2022
Releases(v1.1.0)
Owner
Amber.gg
Amber.gg
print faceit elo into the console/chat via telnet

Print MM Ranks and FaceIT elo ingame This tool uses telnet to interact with the console in CS:GO Description Gets faceit elo via the official faceit a

Dominik Wolf 5 Sep 20, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
NPM Package that simplifies Auth with Google OAuth2 🔐

Node Google OAuth2 ?? A simple authentication flow for Google OAuth2 Explore the docs » Report Bug Table of Contents About The Project Getting Started

Adarsh C 8 Jun 17, 2022
spartacus是一个基于Spring Boot 2.3.x、Spring Cloud Hoxton.SR5、Spring Security 2.3.x、OAuth2.0、Python3等开源框架构建的分布式系统

spartacus是一个基于Spring Boot 2.3.x、Spring Cloud Hoxton.SR5、Spring Security 2.3.x、OAuth2.0、Python3等开源框架构建的分布式系统,亦是一个功能完备的微服务脚手架。

xlvchao 108 Dec 24, 2022
An OAuth2 Authorization Server,Based on Spring Authorization Server

?? id-server 一个基于Spring Authorization Server的开源的授权服务器。 概念 一些概念 OAuth2Client 客户端指的是OAuth2 Client,但又不单单是一个OAuth2 Client,连id server本身都是一个客户端。 role 角色必须依附

felord.cn 351 Dec 30, 2022
A collection of social media strategies for remix-auth

Remix Auth Socials A collection of Remix Auth strategies for Oauth2 Social logins. ?? If you are interested in creating one of the planned strategies,

Tom Rowe 80 Jan 5, 2023
It's a set of common utility strategies to work with responsive styles with Flutter and CSS in JS

@skynexui/responsive_stylesheet You don't need to be worried just because you have to support multiple screens ?? ?? ?? ?? It's a set of common utilit

SkynexUI 40 Oct 26, 2022
Detect F12 open console, protect web static resources, support redirect, rewrite, callback strategies.

console-ban Detect F12 open browser console. protect web site static resources, support redirect, rewrite, custom callback strategies. Language: Engli

Yingci 623 Dec 26, 2022