🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

auth-sdk-para

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

auth-sdk-para

``` npm i react-sdk-test-para ```

unpublished
latest
npmnpm
Version
1.0.30
Version published
Maintainers
1
Created
Source

安装

npm i react-sdk-test-para

使用

import { SAPAuth } from "react-sdk-test-para";

const configs = {
  baseUrl: "http://1.1.1.1",
  client_id: "634a0b0f823459d85447118",
  redirect_uri: "http://127.0.0.1:3000",
  response_type: "id_token",
}

const authSAP = new SAPAuth(configs)

// 生成认证地址跳转认证
let url = authSAP.getAuthorizationUrl()

认证后获取 access_token、id_token、userinfo

const info = sapAuth.getIdToken()

// 返回参数
// {id_token: 'xxx', access_token: '', userInfo: }

用户登录信息浏览器本地存储

  • localStorage
  • key: loginInfo
  • value: {id_token: 'xxx', access_token: '', userInfo: }

API

| 参数 | 类型 | 解释 | | ---- | ---- | ---- | | config | ISAPAuthConfig | 配置参数 | | ISAPAuthConfig | | | | baseUrl | string | 认证地址 | | client_id | string | 应用认证id | | response_type | string | 'id_token' |

FAQs

Package last updated on 22 Jan 2024

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