npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cidaas-cordova-sdk

v1.0.2

Published

cidaas cordova sdk for mobile applications

Downloads

5

Readme

cidaas-cordova-sdk

The steps here will guide you through setting up and managing authentication and authorization in your apps using cidaas cordova SDK.

Table of Contents

Installation

Cidaas cordova sdk is available through npm.

npm install cidaas-cordova-sdk
npm install cordova-plugin-inappbrowser

Getting started

The following steps are to be followed to use this cidaas SDK.

var options = {
    authority: 'your domain base url',
    client_id: 'your app id',
    redirect_uri: 'your redirect url',
    response_type: 'id_token token',
    scope: 'openid email roles profile'
}
var web = new CidaasCordovaSDK.WebAuth(options);

The following sections will help you to generate some of the information that is needed for the options.

Getting Client Id and urls

You can get this by creating your App in App settings section of cidaas Admin portal. Once you select the right scope and application type, and fill in all mandatory fields, you can use the generated Client ID and redirect URLs.

Usage

Login

You can login using your native browser and you will be redirected to the App after successful login. To login with your native browser call loginWithBrowser().

Sample Code

web.loginWithBrowser(options, function (data) {
    // your code
});

Response

{
    "success": true,
    "status": 200,
    "data": {
        "token_type": "Bearer",
        "expires_in": 86400,
        "access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjUxNWYxMGE5LTV",
        "session_state": "CNT7TF6Og-cCNq4Y68",
        "refresh_token": "jahsdujagsudyasasdfsdf",
        "viewtype": "login",
        "grant_type": "login"
    }
}

Note : please refer InAppBrowser_options for more details

Getting user profile

You can get user profile by calling getUserInfo().

Sample Code

web.getUserInfo({
    access_token: 'your access_token'
}).then(function (data) {
    // your success code
}).catch(function (ex) {
    // your failure code
});

Response

{
    "sub": "cc28a557-ce0d-4896-9580-49639cbde8d5",
    "email": "[email protected]",
    "email_verified": true,
    "name": "David Jhonson",
    "family_name": "Jhonson",
    "given_name": "David",
    "nickname": "test",
    "preferred_username": "davidjhonson",
    "gender": "Male",
    "locale": "en-us",
    "updated_at": 1527662349,
    "username": "davidjhonson"
}

Validate token

You can validate the token by calling validateAccessToken().

Sample Code

web.validateAccessToken({
    token: 'your token',
    token_type_hint: 'access_token'
}).then(function (data) {
    // your success code
}).catch(function (ex) {
    // your failure code
});

Response

{
    "active": true
}

Renew token

You can renew your token by calling renewToken().

Sample Code

web.renewToken({
    refresh_token: 'your refresh_token'
}).then(function (data) {
    // your success code
}).catch(function (ex) {
    // your failure code
});

Response

{
    "success": true,
    "status": 200,
    "data": {
        "token_type": "Bearer",
        "expires_in": 86400,
        "access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjUxNWYxMGE5LTV",
        "session_state": "CNT7TF6Og-cCNq4Y68",
        "refresh_token": "jahsdujagsudyasasdfsdf",
        "viewtype": "login",
        "grant_type": "login"
    }
}

Logout

To logout the session, call logout().

Sample Code

web.logout(access_token, options, function (data) {
    // your success code
});

or simply call,

web.logout(access_token);