-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathAuthService.ts
More file actions
143 lines (133 loc) · 3.57 KB
/
AuthService.ts
File metadata and controls
143 lines (133 loc) · 3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { UserLogin } from '../models/UserLogin';
import type { CancelablePromise } from '../core/CancelablePromise';
import { request as __request } from '../core/request';
export class AuthService {
/**
* Register
* @returns any Successful Response
* @throws ApiError
*/
public static registerApiV2AuthRegisterGet(): CancelablePromise<any> {
return __request({
method: 'GET',
path: `/api/v2/auth/register`,
});
}
/**
* Loginget
* Redirect to keycloak login page.
* @returns any Successful Response
* @throws ApiError
*/
public static loginGetApiV2AuthLoginGet(): CancelablePromise<any> {
return __request({
method: 'GET',
path: `/api/v2/auth/login`,
});
}
/**
* Loginpost
* Client can use this to login when redirect is not available.
* @param requestBody
* @returns any Successful Response
* @throws ApiError
*/
public static loginPostApiV2AuthLoginPost(
requestBody: UserLogin,
): CancelablePromise<any> {
return __request({
method: 'POST',
path: `/api/v2/auth/login`,
body: requestBody,
mediaType: 'application/json',
errors: {
422: `Validation Error`,
},
});
}
/**
* Logout
* Logout of keycloak.
* @returns any Successful Response
* @throws ApiError
*/
public static logoutApiV2AuthLogoutGet(): CancelablePromise<any> {
return __request({
method: 'GET',
path: `/api/v2/auth/logout`,
});
}
/**
* Auth
* Redirect endpoint Keycloak redirects to after login.
* @param code
* @returns any Successful Response
* @throws ApiError
*/
public static authApiV2AuthGet(
code: string,
): CancelablePromise<any> {
return __request({
method: 'GET',
path: `/api/v2/auth`,
query: {
'code': code,
},
errors: {
422: `Validation Error`,
},
});
}
/**
* Token
* @param code
* @returns any Successful Response
* @throws ApiError
*/
public static tokenApiV2AuthTokenGet(
code: string,
): CancelablePromise<any> {
return __request({
method: 'GET',
path: `/api/v2/auth/token`,
query: {
'code': code,
},
errors: {
422: `Validation Error`,
},
});
}
/**
* Refresh Token
* @returns any Successful Response
* @throws ApiError
*/
public static refreshTokenApiV2AuthRefreshTokenGet(): CancelablePromise<any> {
return __request({
method: 'GET',
path: `/api/v2/auth/refresh_token`,
});
}
/**
* Get Idenity Provider Token
* Get identity provider JWT token from keyclok. Keycloak must be configured to store external tokens.
* @param identityProvider
* @returns any Successful Response
* @throws ApiError
*/
public static getIdenityProviderTokenApiV2AuthBrokerIdentityProviderTokenGet(
identityProvider: string,
): CancelablePromise<any> {
return __request({
method: 'GET',
path: `/api/v2/auth/broker/${identityProvider}/token`,
errors: {
422: `Validation Error`,
},
});
}
}