Simplified Cloud Foundry Identity Service calls for javascript. | Read-only mirror of https://github.com/swisscom/cloudfoundry-identity-admin — Swisscom. Issues & pull requests at the source.
  • JavaScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-10-28 15:46:54 +01:00
.vscode fix(testing): added more unit tests 2018-11-06 17:25:49 +01:00
src fix(testing): moved tests in a seperator folder 2018-11-06 17:56:25 +01:00
test perf(rename): renamed project to cloudfoundry-identity-admin 2018-11-14 13:06:37 +01:00
.gitattributes Initial commit 2018-11-06 11:18:38 +01:00
.gitignore Initial commit 2018-11-06 11:18:38 +01:00
.travis.yml feat(semantic release automated) 2018-11-06 13:52:58 +01:00
CODE_OF_CONDUCT.md Compliance bulk update. Add CODE_OF_CONDUCT.md 2024-10-28 15:46:54 +01:00
CONTRIBUTING.md Compliance bulk update. Add CONTRIBUTING.md 2024-10-28 15:46:53 +01:00
LICENSE fix(license): added correct copyright holder (Swisscom (Schweiz) AG) 2018-11-14 13:26:02 +01:00
package-lock.json perf(rename): renamed project to cloudfoundry-identity-admin 2018-11-14 13:06:37 +01:00
package.json fix(text): fixed text Swisscom => swisscom 2018-11-14 13:11:41 +01:00
README.md fix(text): fixed text Swisscom => swisscom 2018-11-14 13:11:41 +01:00

cloudfoundry-identity-admin

NPM version Build Status semantic-release JavaScript Style Guide License: MIT

Simplified Cloudfoundry Identity Service calls for javascript.

Install

Install with npm:

$ npm install cloudfoundry-identity-admin --save

Usage

var cloudfoundryIdentityAdmin = require('cloudfoundry-identity-admin');

API

.checkToken

Checks token for his validity.

Params

  • endpointUrlCheckToken {String}: url endpoint.
  • clientId {String}: client id of corpid service.
  • clientSecret {String}: client secret of corpid service.
  • token {String}: token to validate.
  • returns {Promise}

Example

var cloudfoundryIdentityAdmin = require('cloudfoundry-identity-admin');
cloudfoundryIdentityAdmin.checkToken(
    'http://localhost/check_token',
    'YOUR_CLIENT_ID',
    'YOUR_CLIENT_SECRET',
    'TOKEN_TO_VALIDATE'
    )
    .then((results) => {
        //check in results if token valid
    })
    .catch((error => {
        //token not valid
    }))

.userinfo

Get userinfo from a usertoken.

Params

  • endpointUrlUserinfo {String}: url endpoint.
  • token {String}: usertoken.
  • returns {Promise}

Example

var cloudfoundryIdentityAdmin = require('cloudfoundry-identity-admin');
cloudfoundryIdentityAdmin.userinfo(
    'http://localhost/userinfo',
    'USERTOKEN'
    )
    .then((results) => {
        //check results for userinfo
    })
    .catch((error => {
        //userinfo not found
    }))

forthebadge forthebadge forthebadge forthebadge