Disable session iframe in Corodova
This commit is contained in:
parent
2074e1423f
commit
dd30a35e1e
3 changed files with 8 additions and 6 deletions
|
@ -8,14 +8,11 @@
|
|||
<script type="text/javascript" charset="utf-8">
|
||||
var keycloak = new Keycloak();
|
||||
|
||||
keycloak.onReady = updateState;
|
||||
keycloak.onAuthSuccess = updateState;
|
||||
keycloak.onAuthRefreshSuccess = updateState;
|
||||
keycloak.onAuthLogout = updateState;
|
||||
|
||||
function updateState() {
|
||||
console.debug('Updating state');
|
||||
|
||||
if (keycloak.authenticated) {
|
||||
document.getElementById('authenticated').style.display = 'block';
|
||||
document.getElementById('not-authenticated').style.display = 'none';
|
||||
|
@ -31,8 +28,6 @@
|
|||
}
|
||||
|
||||
document.addEventListener("deviceready", function() {
|
||||
console.debug('Device ready');
|
||||
|
||||
keycloak.init({ onLoad: 'check-sso' });
|
||||
}, false);
|
||||
</script>
|
||||
|
@ -42,6 +37,7 @@
|
|||
<div>
|
||||
<button onclick="keycloak.logout()">Log out</button>
|
||||
<button onclick="keycloak.updateToken()">Refresh token</button>
|
||||
<button onclick="keycloak.updateToken(9999)">Force Refresh token</button>
|
||||
<button onclick="keycloak.accountManagement()">Manage account</button>
|
||||
</div>
|
||||
<div>
|
||||
|
|
|
@ -617,6 +617,8 @@ var Keycloak = function (config) {
|
|||
}
|
||||
|
||||
if (type == 'cordova') {
|
||||
loginIframe.enable = false;
|
||||
|
||||
return {
|
||||
login: function(options) {
|
||||
var promise = createPromise();
|
||||
|
|
|
@ -128,7 +128,11 @@ public class RealmsResource {
|
|||
}
|
||||
|
||||
for (String r : TokenService.resolveValidRedirects(uriInfo, client.getRedirectUris())) {
|
||||
r = r.substring(0, r.indexOf('/', 8));
|
||||
int i = r.indexOf('/', 8);
|
||||
if (i != -1) {
|
||||
r = r.substring(0, i);
|
||||
}
|
||||
|
||||
if (r.equals(origin)) {
|
||||
valid = true;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue