Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RocketChatOpenIDpreBind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hosting
fairlogin
RocketChatOpenIDpreBind
Commits
22e028d1
Commit
22e028d1
authored
7 years ago
by
Armin Felder
Browse files
Options
Downloads
Patches
Plain Diff
moved from popup to iframe
parent
2575519a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
index.html
+24
-3
24 additions, 3 deletions
index.html
with
24 additions
and
3 deletions
index.html
+
24
−
3
View file @
22e028d1
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
var
token
=
""
;
var
token
=
""
;
var
secret
=
""
;
var
secret
=
""
;
var
redirectUrl
=
""
;
var
client
=
new
Asteroid
(
host
,
secure
);
var
client
=
new
Asteroid
(
host
,
secure
);
var
redirectToRC
=
function
()
{
var
redirectToRC
=
function
()
{
...
@@ -75,6 +77,23 @@
...
@@ -75,6 +77,23 @@
},
100
);
},
100
);
};
};
var
initOpenIdIframe
=
function
(
url
){
var
iframe
=
document
.
getElementById
(
"
idpIframe
"
);
iframe
.
src
=
url
;
var
checkIframeState
=
setInterval
(
function
(){
var
src
=
iframe
.
contentDocument
.
location
.
href
;
if
(
src
.
startsWith
(
redirectUrl
)){
clearInterval
(
checkIframeState
);
var
secret
=
localStorage
.
getItem
(
'
Meteor.oauth.credentialSecret-
'
+
token
);
if
(
token
!=
""
&&
secret
!=
""
)
{
LoginWithOpenId
(
url
,
token
,
secret
);
}
}
},
100
);
};
var
trySessionRestore
=
function
(){
var
trySessionRestore
=
function
(){
var
cookieObj
=
getCookieObj
();
var
cookieObj
=
getCookieObj
();
if
(
cookieObj
&&
cookieObj
[
"
rc_uid
"
]
&&
cookieObj
[
"
rc_token
"
]){
if
(
cookieObj
&&
cookieObj
[
"
rc_uid
"
]
&&
cookieObj
[
"
rc_token
"
]){
...
@@ -145,7 +164,7 @@
...
@@ -145,7 +164,7 @@
var
generateOIDUrl
=
function
(
serverUrl
,
authorizePath
,
clientId
){
var
generateOIDUrl
=
function
(
serverUrl
,
authorizePath
,
clientId
){
var
hostname
=
window
.
location
.
protocol
;
var
hostname
=
window
.
location
.
protocol
;
var
redirectUrl
=
window
.
location
.
protocol
+
"
//
"
+
window
.
location
.
hostname
+
"
/_oauth/fairlogin
"
;
redirectUrl
=
window
.
location
.
protocol
+
"
//
"
+
window
.
location
.
hostname
+
"
/_oauth/fairlogin
"
;
var
chars
=
"
abcdefghijklmnopqrstuvwxyz0123456789
"
;
var
chars
=
"
abcdefghijklmnopqrstuvwxyz0123456789
"
;
token
=
""
;
token
=
""
;
for
(
var
i
=
0
;
i
<
32
;
i
++
){
for
(
var
i
=
0
;
i
<
32
;
i
++
){
...
@@ -160,6 +179,7 @@
...
@@ -160,6 +179,7 @@
var
b64
=
btoa
(
objStr
);
var
b64
=
btoa
(
objStr
);
var
oidUrl
=
serverUrl
+
authorizePath
+
"
?client_id=
"
+
clientId
+
"
&redirect_uri=
"
var
oidUrl
=
serverUrl
+
authorizePath
+
"
?client_id=
"
+
clientId
+
"
&redirect_uri=
"
+
redirectUrl
+
"
&response_type=code&state=
"
+
b64
+
"
&scope=openid
"
;
+
redirectUrl
+
"
&response_type=code&state=
"
+
b64
+
"
&scope=openid
"
;
return
oidUrl
;
return
oidUrl
;
};
};
...
@@ -181,7 +201,8 @@
...
@@ -181,7 +201,8 @@
serverURL
=
fields
[
"
serverURL
"
];
serverURL
=
fields
[
"
serverURL
"
];
tokenPath
=
fields
[
"
tokenPath
"
];
tokenPath
=
fields
[
"
tokenPath
"
];
var
url
=
generateOIDUrl
(
serverURL
,
authorizePath
,
clientId
);
var
url
=
generateOIDUrl
(
serverURL
,
authorizePath
,
clientId
);
initOpenIdLogin
(
url
);
//initOpenIdLogin(url);
initOpenIdIframe
(
url
);
}
}
}
}
}
}
...
@@ -192,7 +213,7 @@
...
@@ -192,7 +213,7 @@
</script>
</script>
</head>
</head>
<body>
<body>
<iframe
id=
"idpIframe"
src=
""
></iframe>
</body>
</body>
</html>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment