Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
@storyblok/app-extension-auth
Advanced tools
@storyblok/app-extension-auth A typed JavaScript library that manages authentication for Storyblok<
A typed JavaScript library that manages authentication for Storyblok apps.
Under the app settings > Oauth 2, handle configure the following:
URL to your app: https://[your-domain]/
OAuth2 callback URL https://[your-domain]/api/connect/storyblok/callback
(Substitute [your-domain] to your app's domain.)
On Linux/Mac, run:
openssl rand -base64 64
In your source code, create an options object:
import { AuthHandlerParams,} from '@storyblok/app-extension-auth'
export const params: AuthHandlerParams = {
// Provide values for all keys
}
In NodeJS, create a dynamic route that handles the incoming requests with authHandler()
. See Framework examples.
For example, in Next.js, create a file pages/api/connect/[...slugs].ts
:
import { authHandler } from '@storyblok/app-extension-auth'
export default authHandler(params)
Sign in a user by redirecting to the api route: /api/connect/storyblok
This will initiate the oauth flow and redirect the user to the url specified in the successCallback
url. The following query parameters will be appended:
userId
spaceId
Now use these query parameters to retrieve the session object:
import { sessionCookieStore } from '@storyblok/app-extension-auth'
const sessionStore = sessionCookieStore(params)(context)
const appSession = await sessionStore.get(query)
if(appSession === undefined){
// The user is not authenticated
// redirect to /api/connect/storyblok
}
In Next.js, create a file pages/api/connect/[...slugs].ts
import { authHandler } from '@storyblok/app-extension-auth'
export default authHandler(params)
In ExpressJs, create a route
import { authHandler } from '@storyblok/app-extension-auth'
app.all(
'/api/connect/*',
authHandler(params)
)
TODO: This has not been tested
FAQs
A typed JavaScript library for handling authentication with Storyblok apps.
The npm package @storyblok/app-extension-auth receives a total of 136 weekly downloads. As such, @storyblok/app-extension-auth popularity was classified as not popular.
We found that @storyblok/app-extension-auth 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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.