I am not able to set client-secret in config object of keyClock
function initializeKeycloak(keycloak: KeycloakService) {
return () =>
keycloak.init({
config: {
url: 'http://localhost:8080/auth',
realm: 'your-realm',
clientId: 'your-client-id',
client-secret: 'xxxxxxxxxxx' <-- problem
},
initOptions: {
onLoad: 'check-sso',
silentCheckSsoRedirectUri:
window.location.origin + '/assets/silent-check-sso.html',
},
});
}
where we can set clicnt-secret? please help me with it Thank you
I am not able to set client-secret in config object of keyClock
function initializeKeycloak(keycloak: KeycloakService) {
return () =>
keycloak.init({
config: {
url: 'http://localhost:8080/auth',
realm: 'your-realm',
clientId: 'your-client-id',
client-secret: 'xxxxxxxxxxx' <-- problem
},
initOptions: {
onLoad: 'check-sso',
silentCheckSsoRedirectUri:
window.location.origin + '/assets/silent-check-sso.html',
},
});
}
where we can set clicnt-secret? please help me with it Thank you
Share Improve this question asked Mar 16, 2021 at 13:52 shubham sonishubham soni 411 silver badge4 bronze badges1 Answer
Reset to default 7A client application is considered public when an end user could possibly view and modify the code. This includes Single-Page Apps (SPAs) or any mobile or native applications. In both cases, the application can't keep secrets from malicious users.
So your Angular code is public and it can't keep any secret. Don't save any secrets there, but use public OIDC client and Authorization Code Flow with PKCE
, which is designated for that.
Please read doc of used library to have more details. Just idea (not a full working copy&paste code!):
function initializeKeycloak(keycloak: KeycloakService) {
return () =>
keycloak.init({
config: {
url: 'http://localhost:8080/auth',
realm: 'your-realm',
clientId: 'your-client-id'
},
initOptions: {
checkLoginIframe: false,
pkceMethod: 'S256'
onLoad: 'login-required'
},
});
}
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744797851a4594311.html
评论列表(0条)