![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@i-360/auth-ui
Advanced tools
Package for authenticating a user using their Koch ID
git clone git@gitlab.com:i-360/dataops/auth-ui.git
pnpm install
(from repo root directory)pnpm example
The package is published to the NPM registry and can be installed with your preferred package manager:
npm i @i-360/auth-ui
yarn add @i-360/auth-ui
pnpm add @i-360/auth-ui
After installing, import the Auth class into the application and initialize it. Then call the login method.
user<Object|undefined>
=> The user object or undefined when not logged in (getter only, can not be set)token<string|undefined>
=> The users token or undefined when not logged in (getter only, can not be set)login<function>
=> Start the login flow for the userlogout<function>
=> Log a user out of the applicationstatus<function>
=> Check the login status of the Userexpired<function>
=> Validate if the user token is expiredonToken<function>
=> Should be called with the idToken from within the pop-window when redirecteddecode<function>
=> Helper for decoding JWT tokens (Not commonly used)Example
// Initialize the Auth class
const auth = new Auth({
// URL used to login the user
loginUrl: `https://example.i-360.com/kochid/login`,
// URL used to logout the user
logoutUrl: `https://example.i-360.com/kochid/logout`,
// URL to redirect to once authenticated
redirectUri: `my-application.com`,
// Login callback called when the user is logged in
onLogin: (user, token) => { /* Handle user and token */ },
// Error callback called when the there is an error during authentication
onError: (error) => { /* Handle authentication error */ },
// Logout callback called when the user is logged out
onLogout: () => { /* Handle User logout */ },
})
// Call the login method to log the user into the application
// Calls the passed in `onLogin` callback after logging in the user
await auth.login()
// Get the current user or token, both are undefined if not logged in
const user = auth.user
const token = auth.token
// Setting the user or token manually will NOT work. A warning will be printed to the console
auth.user = {}
auth.token = `custom-token`
// Check if the token is expired, returned false if no user or token, or the token is expired
const isExpired = auth.expired()
// Call the logout method to log the user out of the application
// Calls the passed in `onLogout` callback after logging out the user
auth.logout()
FAQs
i360 Auth UI
The npm package @i-360/auth-ui receives a total of 0 weekly downloads. As such, @i-360/auth-ui popularity was classified as not popular.
We found that @i-360/auth-ui 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.