1.8.0 • Published 2 years ago

@myvalue/sso v1.8.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

MyValue SSO Web

MyValue SSO Web is a library that is used to make it easier for you to use single sign on from myvalue

Usage

Using NPM or Yarn

  • Install library using npm or yarn

    $ npm install @myvalue/sso
    or 
    $ yarn add @myvalue/sso
  • Import library by using the steps as below

    // Import Library
    const $myvalue = require('@myvalue/sso')
    
    // Init client instance
    $myvalue.init({
      app: '<your_app_name>',
      clientID: '<your_myvalue_client_id>',
      state: '<your_state>',
      redirectUri: '<your_redirectUri>,
      seamless: {
          show: true || false, // by default is false,
          isLogin: true || false, // by default is false,
      },
      chooseAccount: {
          show: true || false, // by default is false,
      },
      environment: 'development' || 'production' // by default is production 
    });
    
    // Call MyValue SSO Login Page
    $myvalue.login()
    
    // Call MyValue SSO Register Page
    $myvalue.register()
  • Import library and usage library with import function

  // Import library
  import { init, login, register } from '@myvalue/sso'

  // Init client instance
  init({
    app: '<your_app_name>',
    clientID: '<your_myvalue_client_id>',
    state: '<your_state>',
    redirectUri: '<your_redirectUri>,
    seamless: {
        show: true || false, // by default is false,
        isLogin: true || false, // by default is false,
    },
    chooseAccount: {
        show: true || false, // by default is false,
    },
    environment: 'development' || 'production' // by default is production 
  });

  // Call MyValue SSO Login Page
  login()

  // Call MyValue SSO Register Page
  register()

Using Script Tag

  • Import Script JS
  <script src="https://unpkg.com/@myvalue/sso@latest/dist/myvalue-sso.js" async defer></script>
  • Create client instance and Usage Library
  // Init Client Instance
  window.onload = function () {
    $myvalue.init({
        app: '<your_app_name>',
        clientID: '<your_myvalue_client_id>',
        state: '<your_state>',
        redirectUri: '<your_redirectUri>',
        seamless: {
            show: true || false, // by default is false,
            isLogin: true || false, // by default is false,
        },
        chooseAccount: {
            show: true || false, // by default is false,
        },
        environment: 'development' || 'production' // by default is production 
    });
  };

  // Call MyValue SSO Login Page
  $myvalue.login()

  // Call MyValue SSO Register Page
  $myvalue.register()

List Parameter for init client instance

ParamsTypeDescription
appStringName your application
clientIDStringClientID SSO MyValue
stateStringState SSO MyValue
redirectUriStringRedirect uri your application
seamless.showBooleanTo enable myvalue seamless login feature
seamless.isLoginBooleanTo set the conditions if you don't want to show a seamless login pop up when you're logged in
chooseAccount.showBooleanTo enable myvalue choose account login feature
environmentEnum (development / production)To set the environment you want to use in sso myvalue If the value is development, it will use https://auth.ovaltech.id/if the value is production, it will use https://auth.myvalue.id/
1.8.0

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago