fix: enable insecure console

This commit is contained in:
Elio Bischof 2022-06-14 11:55:18 +02:00
parent dd2f31683c
commit e6c10ae937
No known key found for this signature in database
GPG Key ID: 7B383FDE4DDBF1BD
2 changed files with 5 additions and 2 deletions

View File

@ -72,6 +72,7 @@ export class GrpcService {
issuer: data.issuer,
redirectUri: window.location.origin + this.platformLocation.getBaseHrefFromDOM() + 'auth/callback',
postLogoutRedirectUri: window.location.origin + this.platformLocation.getBaseHrefFromDOM() + 'signedout',
requireHttps: data.secure,
};
this.authenticationService.initConfig(authConfig);

View File

@ -106,7 +106,7 @@ func Start(config Config, externalSecure bool, issuer op.IssuerFromRequest, inst
return
}
url := http_util.BuildOrigin(r.Host, externalSecure)
environmentJSON, err := createEnvironmentJSON(url, issuer(r), instance.ConsoleClientID())
environmentJSON, err := createEnvironmentJSON(url, issuer(r), instance.ConsoleClientID(), externalSecure)
if err != nil {
http.Error(w, fmt.Sprintf("unable to marshal env for console: %v", err), http.StatusInternalServerError)
return
@ -127,15 +127,17 @@ func csp() *middleware.CSP {
return &csp
}
func createEnvironmentJSON(api, issuer, clientID string) ([]byte, error) {
func createEnvironmentJSON(api, issuer, clientID string, secure bool) ([]byte, error) {
environment := struct {
API string `json:"api,omitempty"`
Issuer string `json:"issuer,omitempty"`
ClientID string `json:"clientid,omitempty"`
Secure bool `json:"secure"`
}{
API: api,
Issuer: issuer,
ClientID: clientID,
Secure: secure,
}
return json.Marshal(environment)
}