aos-external

1.0.1 • Public • Published

Assistants Center Online Services (AOS) Authorization System External Integration

Install

yarn add aos-external

Usage

const express = require('express');
const app = express();

const AOS_External = require('aos-external');
const AOSClient = new AOS_External({
    AXClientID: '',
    AXClientSecret: '',
    AXRedirectURI: 'http://localhost/api/callback',
    // You must be given access to use specific scopes
    AXScopes: ['user.id', 'user.discord', 'user.assistants_username'],
});

app.get('/login', (req,res)=>{
    const AOSUrl = AOSClient.AccessToken();
    console.log(AOSUrl);
    res.redirect(AOSUrl);
})

app.get('/api/callback', async(req,res)=>{
    const User = await AOSClient.AccessUserData(req.query?.access_token);
    console.log(User);
    res.send(User);
    // Will return
    //
    // {
    //    "error":false,
    //    "data":{
    //       "user_assistants_username":"ASSISTANTS USERNAME",
    //       "user_id":"ASSISTANTS_ACCOUNT_UNIQUE_ID",
    //       "user_discord_id":"DISCORD_USER_ID OR NULL"
    //    }
    // }
});

app.listen(80);

Client ID and Secret & Scopes Access

To get access to External Authorization Integration, please contact us via e-mail: support@assistants.ga asking for it and describing your needs.

Scopes available

user.id - User unique Account ID (could not be changed in any way).

user.discord - User Discord account ID connected (can be changed anytime).

user.assistants_username - User AOS Account username (can be changed anytime).

Readme

Keywords

none

Package Sidebar

Install

npm i aos-external

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

4.02 kB

Total Files

5

Last publish

Collaborators

  • breftejk