Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

account: Response for preflight has invalid HTTP status code 404. #37

Closed
rafaelvicio opened this issue Mar 27, 2018 · 2 comments
Closed
Labels
question This issue is a question.

Comments

@rafaelvicio
Copy link

I'm getting the following error when trying to login to the application.

meukeyloack/auth/realms/meurealm/account Failed to load resource: the server responded with a status of 404 (Not Found)
localhost/:1 Failed to load https://meukeyloack/auth/realms/meurealm/account: Response for preflight has invalid HTTP status code 404.

INIT:

import { KeycloakService } from 'keycloak-angular';

export function initializer(keycloak: KeycloakService): () => Promise {
return (): Promise => {
return new Promise(async (resolve, reject) => {
try {
await keycloak.init({
config: {
url: 'https://meukeyloack/auth',
realm: 'meurealm',
clientId: 'frontline2'
},
initOptions: {
onLoad: 'login-required',
checkLoginIframe: false,
},
bearerExcludedUrls: [
'/teste'
],
});
resolve();
} catch (error) {
reject(error);
}
});
};
}

Package
"dependencies": {
"@angular/animations": "^5.2.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"bootstrap": "^4.0.0",
"core-js": "^2.4.1",
"jquery": "^3.3.1",
"keycloak-angular": "^1.2.5",
"mydatepicker": "^2.6.3",
"popper.js": "^1.14.1",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"
},

@mauriciovigolo mauriciovigolo added the question This issue is a question. label Mar 28, 2018
@mauriciovigolo
Copy link
Owner

Hi @rafaelvicio,

Seems to be a configuration issue in your keycloak, regarding the account scope. Take a look at https://github.com/mauriciovigolo/keycloak-angular#client-configuration:

the client app should have the scope and access to the account view-profile role.

The error you described has an info about the account client from keycloak:

Failed to load https://meukeyloack/auth/realms/meurealm/account

Let me know if it helps you.

Tks!

@mauriciovigolo
Copy link
Owner

Hi @rafaelvicio,

Did you solved this issue? Do you still need any help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This issue is a question.
Projects
None yet
Development

No branches or pull requests

2 participants