Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jxstjh/auth-client

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jxstjh/auth-client

匹配4a认证的客户端工具包 🌼

  • 0.0.11
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-91.89%
Maintainers
1
Weekly downloads
 
Created
Source

AuthClinet

匹配4a单点SSO的前端工具包.

如何使用

当你熟悉单点SSO背后的流程后,你会发现其实变通使用的方法非常自由.但是我们强烈建议按照本文档的使用方法 $ npm install @jxstjh/auth-client

import { AuthClient } from '@jxstjh/auth-client'

const startupService = async () => {
  await doSomething() // ...根据实际情况执行其它前置逻辑
  const ac = new AuthClient({
    routerMode: 'history', // 'history'||'hash' 根据实际项目路由情况选择 缺省值'hash'
    SSOServer: 'https://auth-test.jxwrd.gov.cn/',// 必填 sso认证地址 
    resourceCode: 'code', // 必填 resourceCode || 'code'
  })
  ac.on('error', (err) => {
    console.log(err)
  })
  ac.on('inited', (e) => {
    console.log(e)
    // TODO:成功拿到用户信息及token
    // 设置好vuex
    return e
  })
}
startupService.then(()=>{
  new Vue({
     router,
     store,
     render: h => h(App)
   })
})

流程说明

oxwr3.png

Keywords

FAQs

Package last updated on 12 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc