Wondering what’s next for npm?Check out our public roadmap! »

    uaa-client

    0.1.1 • Public • Published

    Overview

    Simple to use object whose methods are REST wrappers for a UAA in Cloud Foundry.

    Login the Get Users Example

    There must be a UAA instance running in a Cloud Foundry cloud. Then try this:

     
    // Per your UAA set these vars
    var uaaUrl = 'my-uaa-url';
    var clientId = 'my-client-id';
    var secret = 'my-client-secret';
     
    var UaaClient = require('https://github.com/richdost/uaa-client');
    var uaa = new UaaClient(uaaUrl);
     
    uaa.login(clientId,secret)
    .then(loginResult=>{
      console.log('loginResult:',JSON.stringify(loginResult,null,2));
      uaa.getUsers(loginResult.access_token)
      .then(getUsersResult=>{
        console.log('getUsersResult:',JSON.stringify(getUsersResult,null,2));
      })
      .catch(console.log);
    })
    .catch(console.log);
     

    Methods

    Look at the integration tests for examples of use. Here briefly for reference:

    • Constructor UaaClient(uaaUrl)
    • login(client,secret)
    • createClient(clientOptions,token)
    • getClients(token) // token is access_token from login result
    • deleteClient(clientId,token)
    • getUsers(token)
    • addUser(addUserOptions,token)
    • removeUser(userId,token)
    • updatePassword(userId,oldPassword,newPassword,token)
    • refreshToken(refreshToken) // test TODO
    • decodeAccessToken(accessToken) // test TODO

    Testing

    To run the tests do:

    npm run test -- --UAA_URL=<your-uaa-url> --USERNAME=<your-username> --PASSWORD=<your-password>

    License

    Licensed under the Apache License, Version 2.0.

    Forked from IBM-Bluemix/cf-nodejs-client which was in turn forked from prosociallearnEU/cf-nodejs-client.

    Install

    npm i uaa-client

    DownloadsWeekly Downloads

    1

    Version

    0.1.1

    License

    Apache-2.0

    Last publish

    Collaborators

    • avatar