make src/services/api.service.ts work with https servers requiring client certificates. (#4)
This commit is contained in:
parent
d3f3f47286
commit
4c8f9c6b7c
|
@ -76,6 +76,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
async postIdentityToken(request: TokenRequest): Promise<IdentityTokenResponse | IdentityTwoFactorResponse> {
|
async postIdentityToken(request: TokenRequest): Promise<IdentityTokenResponse | IdentityTwoFactorResponse> {
|
||||||
const response = await fetch(new Request(this.identityBaseUrl + '/connect/token', {
|
const response = await fetch(new Request(this.identityBaseUrl + '/connect/token', {
|
||||||
body: this.qsStringify(request.toIdentityToken(this.platformUtilsService.identityClientId)),
|
body: this.qsStringify(request.toIdentityToken(this.platformUtilsService.identityClientId)),
|
||||||
|
credentials: 'include',
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
|
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
|
||||||
|
@ -118,6 +119,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
const response = await fetch(new Request(this.baseUrl + '/two-factor/send-email-login', {
|
const response = await fetch(new Request(this.baseUrl + '/two-factor/send-email-login', {
|
||||||
body: JSON.stringify(request),
|
body: JSON.stringify(request),
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
|
credentials: 'include',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Content-Type': 'application/json; charset=utf-8',
|
'Content-Type': 'application/json; charset=utf-8',
|
||||||
'Device-Type': this.deviceType,
|
'Device-Type': this.deviceType,
|
||||||
|
@ -157,6 +159,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
const authHeader = await this.handleTokenState();
|
const authHeader = await this.handleTokenState();
|
||||||
const response = await fetch(new Request(this.baseUrl + '/accounts/revision-date', {
|
const response = await fetch(new Request(this.baseUrl + '/accounts/revision-date', {
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
|
credentials: 'include',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
'Authorization': authHeader,
|
'Authorization': authHeader,
|
||||||
|
@ -176,6 +179,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
const response = await fetch(new Request(this.baseUrl + '/accounts/password-hint', {
|
const response = await fetch(new Request(this.baseUrl + '/accounts/password-hint', {
|
||||||
body: JSON.stringify(request),
|
body: JSON.stringify(request),
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
|
credentials: 'include',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Content-Type': 'application/json; charset=utf-8',
|
'Content-Type': 'application/json; charset=utf-8',
|
||||||
'Device-Type': this.deviceType,
|
'Device-Type': this.deviceType,
|
||||||
|
@ -193,6 +197,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
const response = await fetch(new Request(this.baseUrl + '/accounts/register', {
|
const response = await fetch(new Request(this.baseUrl + '/accounts/register', {
|
||||||
body: JSON.stringify(request),
|
body: JSON.stringify(request),
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
|
credentials: 'include',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Content-Type': 'application/json; charset=utf-8',
|
'Content-Type': 'application/json; charset=utf-8',
|
||||||
'Device-Type': this.deviceType,
|
'Device-Type': this.deviceType,
|
||||||
|
@ -213,6 +218,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
const response = await fetch(new Request(this.baseUrl + '/folders', {
|
const response = await fetch(new Request(this.baseUrl + '/folders', {
|
||||||
body: JSON.stringify(request),
|
body: JSON.stringify(request),
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
|
credentials: 'include',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
'Authorization': authHeader,
|
'Authorization': authHeader,
|
||||||
|
@ -236,6 +242,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
const response = await fetch(new Request(this.baseUrl + '/folders/' + id, {
|
const response = await fetch(new Request(this.baseUrl + '/folders/' + id, {
|
||||||
body: JSON.stringify(request),
|
body: JSON.stringify(request),
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
|
credentials: 'include',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
'Authorization': authHeader,
|
'Authorization': authHeader,
|
||||||
|
@ -258,6 +265,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
const authHeader = await this.handleTokenState();
|
const authHeader = await this.handleTokenState();
|
||||||
const response = await fetch(new Request(this.baseUrl + '/folders/' + id, {
|
const response = await fetch(new Request(this.baseUrl + '/folders/' + id, {
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
|
credentials: 'include',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Authorization': authHeader,
|
'Authorization': authHeader,
|
||||||
'Device-Type': this.deviceType,
|
'Device-Type': this.deviceType,
|
||||||
|
@ -278,6 +286,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
const response = await fetch(new Request(this.baseUrl + '/ciphers', {
|
const response = await fetch(new Request(this.baseUrl + '/ciphers', {
|
||||||
body: JSON.stringify(request),
|
body: JSON.stringify(request),
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
|
credentials: 'include',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
'Authorization': authHeader,
|
'Authorization': authHeader,
|
||||||
|
@ -301,6 +310,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
const response = await fetch(new Request(this.baseUrl + '/ciphers/' + id, {
|
const response = await fetch(new Request(this.baseUrl + '/ciphers/' + id, {
|
||||||
body: JSON.stringify(request),
|
body: JSON.stringify(request),
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
|
credentials: 'include',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
'Authorization': authHeader,
|
'Authorization': authHeader,
|
||||||
|
@ -323,6 +333,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
const authHeader = await this.handleTokenState();
|
const authHeader = await this.handleTokenState();
|
||||||
const response = await fetch(new Request(this.baseUrl + '/ciphers/' + id, {
|
const response = await fetch(new Request(this.baseUrl + '/ciphers/' + id, {
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
|
credentials: 'include',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Authorization': authHeader,
|
'Authorization': authHeader,
|
||||||
'Device-Type': this.deviceType,
|
'Device-Type': this.deviceType,
|
||||||
|
@ -343,6 +354,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
const response = await fetch(new Request(this.baseUrl + '/ciphers/' + id + '/attachment', {
|
const response = await fetch(new Request(this.baseUrl + '/ciphers/' + id + '/attachment', {
|
||||||
body: data,
|
body: data,
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
|
credentials: 'include',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
'Authorization': authHeader,
|
'Authorization': authHeader,
|
||||||
|
@ -364,6 +376,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
const authHeader = await this.handleTokenState();
|
const authHeader = await this.handleTokenState();
|
||||||
const response = await fetch(new Request(this.baseUrl + '/ciphers/' + id + '/attachment/' + attachmentId, {
|
const response = await fetch(new Request(this.baseUrl + '/ciphers/' + id + '/attachment/' + attachmentId, {
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
|
credentials: 'include',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Authorization': authHeader,
|
'Authorization': authHeader,
|
||||||
'Device-Type': this.deviceType,
|
'Device-Type': this.deviceType,
|
||||||
|
@ -383,6 +396,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
const authHeader = await this.handleTokenState();
|
const authHeader = await this.handleTokenState();
|
||||||
const response = await fetch(new Request(this.baseUrl + '/sync', {
|
const response = await fetch(new Request(this.baseUrl + '/sync', {
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
|
credentials: 'include',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
'Authorization': authHeader,
|
'Authorization': authHeader,
|
||||||
|
@ -460,6 +474,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||||
refresh_token: refreshToken,
|
refresh_token: refreshToken,
|
||||||
}),
|
}),
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
|
credentials: 'include',
|
||||||
headers: new Headers({
|
headers: new Headers({
|
||||||
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
|
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
|
|
Loading…
Reference in New Issue