Skip to content

Commit

Permalink
update docs with new config (#132)
Browse files Browse the repository at this point in the history
* update docs with new config

* fix

* formatting

---------

Co-authored-by: lulu <[email protected]>
  • Loading branch information
luluhoc and lulu authored Jan 11, 2024
1 parent c8b9ffb commit bb501e7
Show file tree
Hide file tree
Showing 7 changed files with 272 additions and 298 deletions.
71 changes: 28 additions & 43 deletions docs/pages/authentication/auth0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,50 +32,35 @@ newly added plugins. To do so here are the steps
Then in your `plugins` collections, if you did not already inserted the plugin, add the following otherwise, you can
just add the `auth0` options to your auth plugin options
```js
{
resolve: "medusa-plugin-auth",
/** @type {import('medusa-plugin-auth').AuthOptions} */
options: {
// strict: "all", // or "none" or "store" or "admin"
auth0: {
clientID: Auth0ClientId,
clientSecret: Auth0ClientSecret,
auth0Domain: Auth0Domain,

admin: {
callbackUrl:`${BACKEND_URL}/admin/auth/auth0/cb`,
failureRedirect: `${ADMIN_URL}/login`,

// The success redirect can be overriden from the client by adding a query param `?redirectTo=your_url` to the auth url
// This query param will have the priority over this configuration
successRedirect: `${ADMIN_URL}/`,

// authPath: '/admin/auth/auth0',
// authCallbackPath: '/admin/auth/auth0/cb',
// expiresIn: 24 * 60 * 60 * 1000,
// verifyCallback: (container, req, accessToken, refreshToken, extraParams, profile, strict) => {
// // implement your custom verify callback here if you need it
// }
},

store: {
callbackUrl:`${BACKEND_URL}/store/auth/auth0/cb`,
failureRedirect: `${STORE_URL}/login`,

// The success redirect can be overriden from the client by adding a query param `?redirectTo=your_url` to the auth url
// This query param will have the priority over this configuration
successRedirect: `${STORE_URL}/`,

// authPath: '/store/auth/auth0',
// authCallbackPath: '/store/auth/auth0/cb',
// expiresIn: 24 * 60 * 60 * 1000,
// verifyCallback: (container, req, accessToken, refreshToken, extraParams, profile, strict) => {
// // implement your custom verify callback here if you need it
// }
}
}
{
resolve: "medusa-plugin-auth",
/** @type {import('medusa-plugin-auth').AuthOptions} */
options: [
{
type: "auth0",
// strict: "all", // or "none" or "store" or "admin"
strict: "none",
identifier: "auth0",
clientID: Auth0ClientId,
clientSecret: Auth0ClientSecret,
auth0Domain: Auth0Domain,
admin: {
callbackUrl: `${BACKEND_URL}/admin/auth/auth0/cb`,
failureRedirect: `${ADMIN_URL}/login`,
// The success redirect can be overridden from the client by adding a query param `?redirectTo=your_url` to the auth url
// This query param will have the priority over this configuration
successRedirect: `${ADMIN_URL}/`
},
store: {
callbackUrl: `${BACKEND_URL}/store/auth/auth0/cb`,
failureRedirect: `${STORE_URL}/login`,
// The success redirect can be overridden from the client by adding a query param `?redirectTo=your_url` to the auth url
// This query param will have the priority over this configuration
successRedirect: `${STORE_URL}/`
}
}
}
]
}
```
The options that are commented are `optional` and the value that you see are the default values
</CircleStep>
Expand Down
118 changes: 59 additions & 59 deletions docs/pages/authentication/azureoidc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,66 +33,66 @@ newly added plugins. To do so here are the steps
Then in your `plugins` collections, if you did not already inserted the plugin, add the following otherwise, you can
just add the `azure_oidc` options to your auth plugin options
```js
{
resolve: "medusa-plugin-auth",
/** @type {import('medusa-plugin-auth').AuthOptions} */
options: {
azure_oidc: {
// strict: "all", // or "none" or "store" or "admin"
admin: {
identityMetadata: AzureIdentityMetadata,
clientID: AzureClientId,
clientSecret: AzureClientSecret,
allowHttpForRedirectUrl: true, //localhost only!
callbackUrl:`${BACKEND_URL}/admin/auth/azure/cb`,
failureRedirect: `${ADMIN_URL}/login`,

// The success redirect can be overriden from the client by adding a query param `?redirectTo=your_url` to the auth url
// This query param will have the priority over this configuration
successRedirect: `${ADMIN_URL}/`,

// responseType: ResposeType.Code
// responseMode: ResponseMode.Query
// allowHttpForRedirectUrl: false
// validateIssuer: true
// isB2C: false
// issuer: null
// authPath: '/admin/auth/azure',
// authCallbackPath: '/admin/auth/azure/cb',
// expiresIn: 24 * 60 * 60 * 1000,
// verifyCallback: (container, req, profile, strict) => {
// // implement your custom verify callback here if you need it
// }
},

store: {
identityMetadata: AzureIdentityMetadata,
clientID: AzureClientId,
clientSecret: AzureClientSecret,
allowHttpForRedirectUrl: true, //localhost only!
callbackUrl:`${BACKEND_URL}/store/auth/azure/cb`,
failureRedirect: `${STORE_URL}/login`,

// The success redirect can be overriden from the client by adding a query param `?redirectTo=your_url` to the auth url
// This query param will have the priority over this configuration
successRedirect: `${STORE_URL}/`,

// responseType: ResposeType.Code
// responseMode: ResponseMode.Query
// allowHttpForRedirectUrl: false
// validateIssuer: true
// isB2C: false
// issuer: null
// authPath: '/store/auth/azure',
// authCallbackPath: '/store/auth/azure/cb',
// expiresIn: 24 * 60 * 60 * 1000,
// verifyCallback: (container, req, profile, strict) => {
// // implement your custom verify callback here if you need it
// }
}
}
{
resolve: "medusa-plugin-auth",
/** @type {import('medusa-plugin-auth').AuthOptions} */
options: [
{
type: "azure_oidc",
// strict: "all", // or "none" or "store" or "admin"
strict: "none",
identifier: "azure_oidc",
admin: {
identityMetadata: AzureIdentityMetadata,
clientID: AzureClientId,
clientSecret: AzureClientSecret,
allowHttpForRedirectUrl: true,
// localhost only!
callbackUrl: `${BACKEND_URL}/admin/auth/azure/cb`,
failureRedirect: `${ADMIN_URL}/login`,
// The success redirect can be overridden from the client by adding a query param `?redirectTo=your_url` to the auth url
// This query param will have the priority over this configuration
successRedirect: `${ADMIN_URL}/`
// responseType: ResposeType.Code
// responseMode: ResponseMode.Query
// allowHttpForRedirectUrl: false
// validateIssuer: true
// isB2C: false
// issuer: null
// authPath: '/admin/auth/azure',
// authCallbackPath: '/admin/auth/azure/cb',
// expiresIn: 24 * 60 * 60 * 1000,
// verifyCallback: (container, req, profile, strict) => {
// // implement your custom verify callback here if you need it
// }
},
store: {
identityMetadata: AzureIdentityMetadata,
clientID: AzureClientId,
clientSecret: AzureClientSecret,
allowHttpForRedirectUrl: true,
// localhost only!
callbackUrl: `${BACKEND_URL}/store/auth/azure/cb`,
failureRedirect: `${STORE_URL}/login`,
// The success redirect can be overridden from the client by adding a query param `?redirectTo=your_url` to the auth url
// This query param will have the priority over this configuration
successRedirect: `${STORE_URL}/`
// responseType: ResposeType.Code
// responseMode: ResponseMode.Query
// allowHttpForRedirectUrl: false
// validateIssuer: true
// isB2C: false
// issuer: null
// authPath: '/store/auth/azure',
// authCallbackPath: '/store/auth/azure/cb',
// expiresIn: 24 * 60 * 60 * 1000,
// verifyCallback: (container, req, profile, strict) => {
// // implement your custom verify callback here if you need it
// }
}
}
}
]
}
```
The options that are commented are `optional` and the value that you see are the default values
</CircleStep>
Expand Down
81 changes: 39 additions & 42 deletions docs/pages/authentication/facebook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,49 +31,46 @@ newly added plugins. To do so here are the steps
Then in your `plugins` collections, if you did not already inserted the plugin, add the following otherwise, you can
just add the `facebook` options to your auth plugin options
```js
{
resolve: "medusa-plugin-auth",
/** @type {import('medusa-plugin-auth').AuthOptions} */
options: {
// strict: "all", // or "none" or "store" or "admin"
facebook: {
clientID: FacebookClientId,
clientSecret: FacebookClientSecret,

admin: {
callbackUrl:`${BACKEND_URL}/admin/auth/facebook/cb`,
failureRedirect: `${ADMIN_URL}/login`,

// The success redirect can be overriden from the client by adding a query param `?redirectTo=your_url` to the auth url
// This query param will have the priority over this configuration
successRedirect: `${ADMIN_URL}/`,

// authPath: '/admin/auth/facebook',
// authCallbackPath: '/admin/auth/facebook/cb',
// expiresIn: 24 * 60 * 60 * 1000,
// verifyCallback: (container, req, accessToken, refreshToken, profile, strict) => {
// // implement your custom verify callback here if you need it
// }
},

store: {
callbackUrl:`${BACKEND_URL}/store/auth/facebook/cb`,
failureRedirect: `${STORE_URL}/login`,

// The success redirect can be overriden from the client by adding a query param `?redirectTo=your_url` to the auth url
// This query param will have the priority over this configuration
successRedirect: `${STORE_URL}/`,

// authPath: '/store/auth/facebook',
// authCallbackPath: '/store/auth/facebook/cb',
// expiresIn: 24 * 60 * 60 * 1000,
// verifyCallback: (container, req, accessToken, refreshToken, profile, strict) => {
// // implement your custom verify callback here if you need it
// }
}
}
{
resolve: "medusa-plugin-auth",
/** @type {import('medusa-plugin-auth').AuthOptions} */
options: [
{
type: "facebook",
// strict: "all", // or "none" or "store" or "admin"
strict: "none",
identifier: "facebook",
clientID: FacebookClientId,
clientSecret: FacebookClientSecret,
admin: {
callbackUrl: `${BACKEND_URL}/admin/auth/facebook/cb`,
failureRedirect: `${ADMIN_URL}/login`,
// The success redirect can be overridden from the client by adding a query param `?redirectTo=your_url` to the auth url
// This query param will have the priority over this configuration
successRedirect: `${ADMIN_URL}/`
// authPath: '/admin/auth/facebook',
// authCallbackPath: '/admin/auth/facebook/cb',
// expiresIn: 24 * 60 * 60 * 1000,
// verifyCallback: (container, req, accessToken, refreshToken, profile, strict) => {
// // implement your custom verify callback here if you need it
// }
},
store: {
callbackUrl: `${BACKEND_URL}/store/auth/facebook/cb`,
failureRedirect: `${STORE_URL}/login`,
// The success redirect can be overridden from the client by adding a query param `?redirectTo=your_url` to the auth url
// This query param will have the priority over this configuration
successRedirect: `${STORE_URL}/`
// authPath: '/store/auth/facebook',
// authCallbackPath: '/store/auth/facebook/cb',
// expiresIn: 24 * 60 * 60 * 1000,
// verifyCallback: (container, req, accessToken, refreshToken, profile, strict) => {
// // implement your custom verify callback here if you need it
// }
}
}
}
]
}
```
The options that are commented are `optional` and the value that you see are the default values
</CircleStep>
Expand Down
51 changes: 26 additions & 25 deletions docs/pages/authentication/firebase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,33 @@ newly added plugins. To do so here are the steps
Then in your `plugins` collections, if you did not already inserted the plugin, add the following otherwise, you can
just add the `firebase` options to your auth plugin options
```js
{
resolve: "medusa-plugin-auth",
/** @type {import('medusa-plugin-auth').AuthOptions} */
options: {
// strict: "all", // or "none" or "store" or "admin"
firebase: {
credentialJsonPath: CredentialJsonPath,

admin: {
// authPath: '/admin/auth/firebase',
// expiresIn: 24 * 60 * 60 * 1000,
// verifyCallback: (container, decodedToken, strict) => {
// // implement your custom verify callback here if you need it
// }
},

store: {
// authPath: '/store/auth/firebase',
// expiresIn: 24 * 60 * 60 * 1000,
// verifyCallback: (container, decodedToken, strict) => {
// // implement your custom verify callback here if you need it
// }
}
}
{
resolve: "medusa-plugin-auth",
/** @type {import('medusa-plugin-auth').AuthOptions} */
options: [
{
type: "firebase",
// strict: "all", // or "none" or "store" or "admin"
strict: "none",
identifier: "firebase",
credentialJsonPath: CredentialJsonPath,
admin: {
// authPath: '/admin/auth/firebase',
// expiresIn: 24 * 60 * 60 * 1000,
// verifyCallback: (container, decodedToken, strict) => {
// // implement your custom verify callback here if you need it
// }
},
store: {
// authPath: '/store/auth/firebase',
// expiresIn: 24 * 60 * 60 * 1000,
// verifyCallback: (container, decodedToken, strict) => {
// // implement your custom verify callback here if you need it
// }
}
}
}
]
}
```
The options that are commented are `optional` and the value that you see are the default values
</CircleStep>
Expand Down
Loading

1 comment on commit bb501e7

@vercel
Copy link

@vercel vercel bot commented on bb501e7 Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

medusa-plugins – ./

medusa-plugins.vercel.app
medusa-plugins-adrien2p.vercel.app
medusa-plugins-git-main-adrien2p.vercel.app

Please sign in to comment.