Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docs with new config #132

Merged
merged 3 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 14 additions & 31 deletions docs/pages/authentication/auth0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,46 +35,29 @@ newly added plugins. To do so here are the steps
{
resolve: "medusa-plugin-auth",
/** @type {import('medusa-plugin-auth').AuthOptions} */
options: {
// strict: "all", // or "none" or "store" or "admin"
auth0: {
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 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
// }
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`,
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
// 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/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
// }
}
}
}
}]
}
```
The options that are commented are `optional` and the value that you see are the default values
Expand Down
114 changes: 56 additions & 58 deletions docs/pages/authentication/azureoidc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,66 +33,64 @@ 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
78 changes: 38 additions & 40 deletions docs/pages/authentication/facebook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,49 +31,47 @@ 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: {
{
resolve: "medusa-plugin-auth",
/** @type {import('medusa-plugin-auth').AuthOptions} */
options: [
{
type: "facebook",
// 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
// }
}
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
48 changes: 25 additions & 23 deletions docs/pages/authentication/firebase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,34 @@ 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: {
{
resolve: "medusa-plugin-auth",
/** @type {import('medusa-plugin-auth').AuthOptions} */
options: [
{
type: "firebase",
// 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
// }
}
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