Skip to content
Snippets Groups Projects
AuthService.ts 2.69 KiB
Newer Older
  • Learn to ignore specific revisions
  • /* generated using openapi-typescript-codegen -- do not edit */
    
    /* istanbul ignore file */
    /* tslint:disable */
    /* eslint-disable */
    
    import type { OIDCProvider } from '../models/OIDCProvider';
    
    import type { CancelablePromise } from '../core/CancelablePromise';
    import { OpenAPI } from '../core/OpenAPI';
    import { request as __request } from '../core/request';
    export class AuthService {
        /**
    
         * Kickstart the login flow
    
         * Redirect route to OIDC provider to kickstart the login process.
    
         * @param invitationToken Unique token to validate an invitation
    
         * @param provider The OIDC provider to use for login
    
         * @param next Will be appended to redirect response in the callback route as URL query parameter `next`
    
         * @returns void
         * @throws ApiError
         */
    
            invitationToken?: string,
    
            next?: string,
    
            return __request(OpenAPI, {
                method: 'GET',
                url: '/auth/login',
    
                    'invitation_token': invitationToken,
    
                    'next': next,
    
                errors: {
                    302: `Successful Response`,
    
                },
            });
        }
        /**
         * LifeScience Login Callback
    
         * Callback for the Life Science Identity Provider.
         *
    
         * Visit the route login route to start the login process.
    
         *
         * If the user is already known to the system, then a JWT token will be created and sent via the 'set-cookie' header.
         * The key for this Cookie is 'bearer'.
         *
         * If the user is new, he will be created and then a JWT token is issued.
         *
         * This JWT has to be sent to all authorized endpoints via the HTTPBearer scheme.
    
        public static authLoginCallback(
            provider: OIDCProvider,
        ): CancelablePromise<void> {
    
            return __request(OpenAPI, {
                method: 'GET',
    
                url: '/auth/callback/{provider}',
                path: {
                    'provider': provider,
                },
    
         * Logout the user from the system by deleting the bearer cookie.
    
         * @returns void
         * @throws ApiError
         */
        public static authLogout(): CancelablePromise<void> {
            return __request(OpenAPI, {
                method: 'GET',
                url: '/auth/logout',
                errors: {
                    302: `Successful Response`,
                },
            });
        }