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

@webiny/api-security-okta

Package Overview
Dependencies
Maintainers
0
Versions
363
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webiny/api-security-okta

Security plugins for Okta

  • 5.41.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
98
decreased by-77.37%
Maintainers
0
Weekly downloads
 
Created
Source

@webiny/api-security-cognito

code style: prettier PRs Welcome

A plugin that enables Amazon Cognito based authentication in @webiny/handler handlers.

Install

npm install --save @webiny/api-security @webiny/api-security-cognito

Or if you prefer yarn:

yarn add @webiny/api-security @webiny/api-security-cognito

Quick Example

The set up process consists only of a single step, and that's adding the plugins in your handler:

import { createHandler } from "@webiny/handler-aws";
import graphqlPlugins from "@webiny/handler-graphql";
import logsPlugins from "@webiny/handler-logs";
import securityPlugins, { SecurityIdentity } from "@webiny/api-security";
import cognitoAuthenticationPlugins from "@webiny/api-security-cognito";

// Imports plugins created via scaffolding utilities.
import scaffoldsPlugins from "./plugins/scaffolds";

const debug = process.env.DEBUG === "true";

export const handler = createHandler({
  plugins: [
    securityPlugins(),
    cognitoAuthenticationPlugins({
      region: process.env.COGNITO_REGION,
      userPoolId: process.env.COGNITO_USER_POOL_ID,
      identityType: "user"
    }),
    logsPlugins(),
    graphqlPlugins({ debug }),
    scaffoldsPlugins()
  ],
  debug
});

With all the plugins in place, you should be able to retrieve the current identity in your handler application code, via the context.security object:

const identity = context.security.getIdentity();

FAQs

Package last updated on 05 Nov 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

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