@highpoint/get-ps-token
Populate cookie jar with PeopleSoft token
Last updated 2 years ago by jkrehm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @highpoint/get-ps-token 
SYNC missed versions from official npm registry.

Get PeopleSoft Token

Populates a cookie jar with PS_TOKEN.

Installation

yarn add -D @highpoint/get-ps-token

Usage

To populate a cookie jar with a valid PS_TOKEN, call getToken with an object that includes the following:

  • PeopleSoft hostname
  • PeopleSoft environment
  • PeopleSoft user name
  • PeopleSoft user password
  • HTTP Auth user name (optional)
  • HTTP Auth user password (optional)

Example

const request = require('request-promise');
const getToken = require('@highpoint/get-ps-token');

require('dotenv').config({ silent: true });

/* 
  Add the following environment variables to a `.env` file in the root of your
  project:
    ISCRIPT_HOSTNAME
    ISCRIPT_ENVIRONMENT
    HTTP_USERNAME
    HTTP_PASSWORD
    PS_USERNAME
    PS_PASSWORD
*/

const makeRequest = async () => {
  request
    .get({
      uri: '...',
      jar: await getToken(process.env)
    })
    .then(response => {
      // ...
    });
};

makeRequest();

API

Key Required Example
PS_HOSTNAME True example.com
PS_ENVIRONMENT True csdev92
PS_USERNAME True user
PS_PASSWORD True password
HTTP_USERNAME False user
HTTP_PASSWORD False password

Example:

const jar = await getToken({
  ISCRIPT_HOSTNAME: 'example.com',
  ISCRIPT_ENVIRONMENT: 'csdev92',
  PS_USERNAME: 'user',
  PS_PASSWORD: 'password1'
});

Current Tags

  • 0.1.2                                ...           latest (2 years ago)

3 Versions

  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Downloads
Today 0
This Week 3
This Month 4
Last Day 0
Last Week 1
Last Month 2
Dependencies (2)
Dev Dependencies (6)

Copyright 2014 - 2016 © taobao.org |