Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@authing/guard
Advanced tools
English | 简体中文
Guard is a portable authentication component provided by authing. You can embed it in any application to handle complex user authentication processes in one stop.
Prepare your native JavaScript project and follow the guide to connect Guard to your native JavaScript project!
From CDN:
<link rel="stylesheet" href="https://cdn.authing.co/packages/guard/5.0.7/guard.min.css" />
<script src="https://cdn.authing.co/packages/guard/5.0.7/guard.min.js"></script>
From NPM:
npm install --save @authing/guard
Key | Type | Default | Requires |
---|---|---|---|
appId | String | - | Y |
host | String | - | N |
redirectUri | String | - | N |
mode | normal / modal | normal | N |
defaultScene | GuardModuleType | login | N |
tenantId | String | - | N |
lang | zh-CN / en-US | zh-CN | N |
isSSO | Boolean | true | N |
config | Partial | - | N |
// From CDN
const guard = new GuardFactory.Guard({
appId: '62e22721c889dd44bad1dda2',
host: 'https://guard-test-2022.authing.cn',
redirectUri: 'http://localhost:3000/callback'
})
// From npm
const guard = new Guard({
appId: '62e22721c889dd44bad1dda2',
host: 'https://guard-test-2022.authing.cn',
redirectUri: 'http://localhost:3000/callback'
})
Render Guard component
guard.start('#root').then(userInfo => {
console.log(userInfo)
})
When the parameter 'mode' of Guard instantiation is' modal ', the modal mode is started, and the following API can be used to display and hide the guard.
guard.show()
guard.hide()
Login by code, redirect to login page
guard.startWithRedirect()
Auto handle redirect callback
guard.handleRedirectCallback()
Logout
guard.logout()
guard.on('load', e => {
console.log(e)
})
guard.on('login', userInfo => {
console.log(userInfo)
})
// ......
Guard integrated AuthenticationClient, so you can access all apis of AuthenticationClient, etc:
guard.getAuthClient().then(authClient => {
authClient.registerByEmail()
authClient.validateToken()
// .........
})
// ....
Refer to Authentication SDK
To check out live examples and docs, visit docs
FAQs
Guard for JS
The npm package @authing/guard receives a total of 8 weekly downloads. As such, @authing/guard popularity was classified as not popular.
We found that @authing/guard demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.