Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-rest
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-rest
Commits
fd24b7a8
Commit
fd24b7a8
authored
Jan 06, 2011
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- now supporting expiry date in auto-login tokens
parent
85086002
Pipeline
#413
failed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
intranet-rest-procs.tcl
tcl/intranet-rest-procs.tcl
+3
-1
auto-login.adp
www/auto-login.adp
+2
-1
auto-login.tcl
www/auto-login.tcl
+8
-1
No files found.
tcl/intranet-rest-procs.tcl
View file @
fd24b7a8
...
...
@@ -1386,13 +1386,15 @@ ad_proc -private im_rest_authenticate {
# Check for token authentication
set token_user_id
""
set token_token
""
set expiry_date
""
if
{[
info
exists query_hash
(
user_id
)]}
{
set token_user_id
$query
_hash
(
user_id
)}
if
{[
info
exists query_hash
(
auth_token
)]}
{
set token_token
$query
_hash
(
auth_token
)}
if
{[
info
exists query_hash
(
auto_login
)]}
{
set token_token
$query
_hash
(
auto_login
)}
if
{[
info
exists query_hash
(
expiry_date
)]}
{
set expiry_date
$query
_hash
(
expiry_date
)}
# Check if the token fits the user
if
{
""
!=
$token
_user_id &&
""
!=
$token
_token
}
{
if
{
!
[
im_valid_auto_login_p -user_id
$token
_user_id -auto_login
$token
_token
]}
{
if
{
!
[
im_valid_auto_login_p -user_id
$token
_user_id -auto_login
$token
_token
-expiry_date
$expiry
_date
]}
{
set token_user_id
""
}
}
...
...
www/auto-login.adp
View file @
fd24b7a8
...
...
@@ -6,7 +6,8 @@
<tr class=roweven><td>User ID</td><td>@user_id@</td></tr>
<tr class=rowodd><td>User</td><td>@name@</td></tr>
<tr class=roweven><td>Username</td><td>@username@</td>
<tr class=rowodd><td>Auto-Login<br>Token</td><td>@auto_login@</td></tr>
<tr class=rowodd><td>Expiry Date</td><td>@expiry_date@</td>
<tr class=roweven><td>Auto-Login<br>Token</td><td>@auto_login@</td></tr>
</tr>
</table>
www/auto-login.tcl
View file @
fd24b7a8
...
...
@@ -25,7 +25,13 @@ ad_page_contract {
if
{
!
[
info
exists user_id
]}
{
set user_id 0
}
if
{
!
[
info
exists format
]}
{
set format
"html"
}
set
auto_login
[
im_generate_auto_login -user_id
$user
_id
]
# Get expiry_date from HTTP headers
set
form_vars
[
ns_conn form
]
if
{
""
==
$form
_vars
}
{
set form_vars
[
ns_set create
]
}
set
expiry_date
[
ns_set get
$form
_vars expiry_date
]
# Generate the auto-login token
set
auto_login
[
im_generate_auto_login -user_id
$user
_id -expiry_date
$expiry
_date
]
set
username
""
set
name
""
...
...
@@ -43,6 +49,7 @@ switch $format {
<user_id>
$user
_id</user_id>
<user_name>
$name
</user_name>
<username>
$username
</username>
<expiry_date>
$expiry
_date</expiry_date>
<token>
$auto
_login</token>
</auto_login>
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment