diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/models/auth-provider.model.ts b/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/models/auth-provider.model.ts new file mode 100644 index 0000000000..e212a5208e --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/models/auth-provider.model.ts @@ -0,0 +1,64 @@ +import type { ManifestElement } from '@umbraco-cms/backoffice/extension-api'; +import type { UUIInterfaceColor, UUIInterfaceLook } from '@umbraco-cms/backoffice/external/uui'; + +/** + * Represents an authentication provider that can be used to authenticate users. + * The provider needs to be registered in the API that the authorization request is sent to in order to be used. + * + * @see {forProviderName} for the provider name that this provider is for. + */ +export interface ManifestAuthProvider extends ManifestElement { + type: 'authProvider'; + + /** + * The provider name that this provider is for. + * @examples 'Umbraco.Github' + */ + forProviderName: string; + + meta?: MetaAuthProvider; +} + +export interface MetaAuthProvider { + /** + * The label of the provider that is shown to the user. + */ + label?: string; + + /** + * The default view of the provider that is shown to the user. + * If no element is provided, then the button will be rendered as a @see {UUIButtonElement} using these options. + */ + defaultView: { + /** + * The icon of the provider that is shown to the user. + * @examples ['icon-cloud', 'icon-github', 'icon-google', 'icon-facebook', 'icon-twitter', 'icon-x', 'icon-microsoft'] + * @default 'icon-cloud' + */ + icon?: string; + + /** + * The color of the provider that is shown to the user. + * @default 'secondary' + */ + color?: UUIInterfaceLook; + + /** + * The look of the provider that is shown to the user. + * @default 'default' + */ + look?: UUIInterfaceColor; + }; + + /** + * If true, the Umbraco backoffice login will be disabled. + * @default false + */ + denyLocalLogin?: boolean; + + /** + * If true, the user will be redirected to the provider's login page immediately. + * @default false + */ + autoRedirect?: boolean; +} diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/models/index.ts b/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/models/index.ts index bd329b9276..c6d951bd27 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/models/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/extension-registry/models/index.ts @@ -1,3 +1,4 @@ +import type { ManifestAuthProvider } from './auth-provider.model.js'; import type { ManifestBlockEditorCustomView } from './block-editor-custom-view.model.js'; import type { ManifestCollection } from './collection.models.js'; import type { ManifestCollectionView } from './collection-view.model.js'; @@ -64,6 +65,7 @@ import type { ManifestEntryPoint, } from '@umbraco-cms/backoffice/extension-api'; +export type * from './auth-provider.model.js'; export type * from './block-editor-custom-view.model.js'; export type * from './collection.models.js'; export type * from './collection-action.model.js'; @@ -131,12 +133,13 @@ export type ManifestWorkspaces = ManifestWorkspace | ManifestWorkspaceRoutableKi export type ManifestWorkspaceViews = ManifestWorkspaceView | ManifestWorkspaceViewContentTypeDesignEditorKind; export type ManifestTypes = + | ManifestAuthProvider | ManifestBundle - | ManifestCondition | ManifestBlockEditorCustomView | ManifestCollection | ManifestCollectionView | ManifestCollectionAction + | ManifestCondition | ManifestDashboard | ManifestDashboardCollection | ManifestDynamicRootOrigin