From 79825dfa1dd512e0e2936a55392bb387f804eeaa Mon Sep 17 00:00:00 2001 From: Ramon Gebben Date: Fri, 25 Nov 2016 11:45:40 +0100 Subject: [PATCH 1/2] Removed compare bug in `checkState` function --- .../main/resources/login-status-iframe.html | 175 +++++++++--------- 1 file changed, 88 insertions(+), 87 deletions(-) diff --git a/adapters/oidc/js/src/main/resources/login-status-iframe.html b/adapters/oidc/js/src/main/resources/login-status-iframe.html index 6bea92ade42..1ddc38a0e3c 100755 --- a/adapters/oidc/js/src/main/resources/login-status-iframe.html +++ b/adapters/oidc/js/src/main/resources/login-status-iframe.html @@ -1,98 +1,99 @@ +~ Copyright 2016 Red Hat, Inc. and/or its affiliates +~ and other contributors as indicated by the @author tags. +~ +~ Licensed under the Apache License, Version 2.0 (the "License"); +~ you may not use this file except in compliance with the License. +~ You may obtain a copy of the License at +~ +~ http://www.apache.org/licenses/LICENSE-2.0 +~ +~ Unless required by applicable law or agreed to in writing, software +~ distributed under the License is distributed on an "AS IS" BASIS, +~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +~ See the License for the specific language governing permissions and +~ limitations under the License. +--> - + return null; + } + + function receiveMessage(event) { + var origin = event.origin, + data = event.data.split(' '), + clientId = data[0], + sessionState = data[1]; + + if (data.length !== 2) { + event.source.postMessage('error', origin); + } + + checkState(clientId, event.origin, sessionState, function (result) { + event.source.postMessage(result, origin); + }); + } + + window.addEventListener('message', receiveMessage, false); + - \ No newline at end of file + From e5ce080fd3b2fdee12bead7aebb94c3ac3528c34 Mon Sep 17 00:00:00 2001 From: Ramon Gebben Date: Tue, 29 Nov 2016 09:49:58 +0100 Subject: [PATCH 2/2] Update with PR feedback --- .../main/resources/login-status-iframe.html | 171 +++++++++--------- 1 file changed, 85 insertions(+), 86 deletions(-) diff --git a/adapters/oidc/js/src/main/resources/login-status-iframe.html b/adapters/oidc/js/src/main/resources/login-status-iframe.html index 1ddc38a0e3c..f941663e4fa 100755 --- a/adapters/oidc/js/src/main/resources/login-status-iframe.html +++ b/adapters/oidc/js/src/main/resources/login-status-iframe.html @@ -1,99 +1,98 @@ + ~ Copyright 2016 Red Hat, Inc. and/or its affiliates + ~ and other contributors as indicated by the @author tags. + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> - + + window.addEventListener("message", receiveMessage, false); +