0.8.2 • Published 3 years ago

@psu/sso v0.8.2

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

Single Sign On Plugin for PSU

View Change Log

Installation

npm install --save @psu/sso

Requirements

Vuex Identity data is stored in the Vuex state. Your app must have Vuex installed, and the store made globally available. See "Usage" section for details

Optional There are no additional dependencies for the SSO component, However:

  • SSO's auto-refresh of JWT expiration only works when making your AJAX requests via jQuery. Therefore, I recommend using a recent version of jQuery from the Static Content Server: https://content.oit.pdx.edu[/nonprod]/wdt/jquery/jquery-3.3.1.js
  • When Font-Awesome is available, the development toolbar and the proxy features will look nicer. I recommend using FontAwesome: https://content.oit.pdx.edu[/nonprod]/font-awesome/css/font-awesome.min.css

Usage

  1. In public/index.html add the optional jQuery and FontAwesome references:
    <script src="https://content.oit.pdx.edu[/nonprod]/wdt/jquery/jquery-3.3.1.js"></script>
    <link rel="stylesheet" href="https://content.oit.pdx.edu/nonprod/font-awesome/css/font-awesome.min.css">
  1. Create /src/store and /src/store/modules directories

  2. Create /src/store/index.js with the following content:

import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex);
export const store = new Vuex.Store({
	strict: true,
	modules: { }
});
  1. In main.js add/include the following lines:
    import { store } from './store'
    import ssoPlugin from '@psu/sso'
    Vue.use(ssoPlugin, {store: store});

    Vue.prototype.$appName = "MY_APP_NAME";  // Your unique app identifier
    Vue.prototype.$envName = "test";         // {local, dev, test, prod}
    
    new Vue({
        store,
        render: h => h(App),
    }).$mount('#app');
  1. In App.vue add the sso component. <sso />

    Optional properties:

    • The title of your application: title="My Awesome App"
    • Fetch the user's roles?: appRoles="Y"
    • Get identity data: additionalIdentity="Y"

Environment Names

$envName: Determines which Finti and SSO environments to use

  • prod: Production instances
  • test: Deployed non-production instances
  • dev: Local Finti with deployed non-production SSO-Proxy
  • local: Locally-run instances of Finti and SSO-Proxy

Accessing identity info

Identity info is stored in the Vuex store as "identity". Use the Vue Devtools browser plugin to see all the available data.

A good way to access the values is to create a computed property to access these values:

computed{
    name: function(){
        return this.$store.state.identity.name
    }
},

If you need access to other data, checkout the $jwt module with functions that interact directly with the JWT.

Publishing Changes

To publish changes to this plugin on NPM, you must first have an NPM account. You must sign into your account on the command line using npm login. You can check to see if you are logged in via npm whoami. You will also need to be added to the @psu scope.

Once you have you npm account in order and you have made your changes to the sso plugin: 1. Be sure to update the version in package.json 2. Run the following two commands:

cd <rootDirectory>
npm run build-bundle
npm publish --access public

Updating the Installed Plugin

npm update @psu/sso
0.8.2

3 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.7.12

5 years ago

0.7.11

5 years ago

0.7.10

5 years ago

0.7.9

5 years ago

0.7.8

5 years ago

0.7.7

5 years ago

0.7.6

5 years ago

0.7.5

5 years ago

0.7.4

5 years ago

0.7.3

5 years ago

0.7.2

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.0

5 years ago

0.5.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.11

5 years ago

0.2.10

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.26

5 years ago

0.1.25

5 years ago

0.1.24

5 years ago

0.1.23

5 years ago

0.1.22

5 years ago

0.1.21

5 years ago

0.1.20

5 years ago

0.1.19

5 years ago

0.1.18

5 years ago

0.1.17

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago