# passport-eveonline-oauth2-2023

> Passport strategy for EVE Online SSO OAuth 2.0

Latest version **0.2.2** (published 2023-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install passport-eveonline-oauth2-2023
pnpm add passport-eveonline-oauth2-2023
yarn add passport-eveonline-oauth2-2023
bun add passport-eveonline-oauth2-2023
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2023-07-17 |
| First published | 2023-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 33.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Google staff: Marcus Stade |
| Maintainers | spider-jerusalem |
| Keywords | passport, eve, eveonline, sso, auth, oauth2, authentication, identity, single sign on |

## Links

- npm: https://www.npmjs.com/package/passport-eveonline-oauth2-2023
- Repository: https://github.com/spider-jeru/passport-oath2-eve-2023
- Issues: https://github.com/spider-jeru/passport-oath2-eve-2023/issues
- npm.io page: https://npm.io/package/passport-eveonline-oauth2-2023

## Dependencies (2)

- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^9.0.1
- [passport-oauth2](https://npm.io/package/passport-oauth2.md) ^1.1.2

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 0.2.2 (latest) — 2023-07-17
- 0.2.1 — 2023-07-17

## README

# Passport strategy for EVE Online SSO OAuth 2.0

[Passport](http://passportjs.org/) strategies for authenticating with [EVE Online](http://www.eveonline.com/)
using ONLY OAuth 2.0.

This module lets you authenticate using EVE Online SSO in your Node.js applications.
By plugging into Passport, EVE Online SSO authentication can be easily and
unobtrusively integrated into any application or framework that supports
[Connect](http://www.senchalabs.org/connect/)-style middleware, including
[Express](http://expressjs.com/).

## Install

    $ npm install passport-eveonline-oauth2-2023

## Usage of OAuth 2.0

#### Create an Application

Before using `passport-eveonline-sso`, you must register your application with
[EVE Online Developers site](https://developers.eveonline.com/)

You will also need to configure an Endpoint redirect URI (`callbackURL`) and scopes your application has access to.

#### Configure Strategy

The EVE Online SSO authentication strategy authenticates users using a EVE Online
account and OAuth 2.0 tokens.  The clientID and clientSecret obtained when creating an application are supplied as options when creating the strategy.  The strategy also requires a `verify` callback, which receives the access token and optional refresh token, as well as `profile` which contains the authenticated user's profile.  The `verify` callback must call `cb` providing a user to
complete authentication.

```js
passport.use(new EveOnlineSsoStrategy({
    clientID: EVEONLINE_CLIENT_ID,
    clientSecret: EVEONLINE_CLIENT_SECRET,
    callbackURL: 'http://localhost:3000/auth/eveonline'
    scope: ''
  },
  function(accessToken, refreshToken, profile, cb) {
    // We have a new authenticated session, you can now store and/or use the accessToken and refreshToken to call EVE Swagger Interface (ESI) end points.

    return done(null, profile);
  }
));
```

#### Note about Local environment

Avoid usage of Private IP, otherwise you will get the device_id device_name issue for Private IP during authentication.

A workaround consist to set up thru the google cloud console a fully qualified domain name such as http://mydomain:3000/ for the callback
then edit your /etc/hosts on your computer and/or vm to point on your private IP.

Also both sign-in button + callbackURL has to be share the same url, otherwise two cookies will be created and it will lead to lost your session

#### Authenticate Requests

Use `passport.authenticate()`, specifying the `'eveonline-sso'` strategy, to
authenticate requests.

For example, as route middleware in an [Express](http://expressjs.com/)
application:

```Javascript
app.get('/auth/eveonline',
  passport.authenticate('eveonline-sso'));

app.get( '/auth/eveonline/callback',
	passport.authenticate( 'eveonline-sso', {
		successRedirect: '/auth/eveonline/success',
		failureRedirect: '/auth/eveonline/failure'
}));
```

## Credits

  - [Jared Hanson](http://github.com/jaredhanson)
  - [Johnny Splunk](http://github.com/johnnysplunk)
  - [Spider Jerusalem](https://github.com/spider-jeru)

## License

[The MIT License](http://opensource.org/licenses/MIT)

---
_Source: https://npm.io/package/passport-eveonline-oauth2-2023 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
