Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Introduction

The One Time Token PAS allows users to login using a special token. The token is generated and can only be used one. This allows members to login without supplying their username and password. You can send an e-mail with the special login url, so the member can access the portal easily.

Installation

This product is written for Plone 2.5 but can easily be used for 3.x.

  • Install thru the quick installer

  • Activate Authentication and Extraction in the OTT plugin, move this plug-in to the top.

Usage

  1. Generate a token:

    getToolByName(self, ‘onetimetoken_storage’)

    token = tokenTool.setToken(userId) logincode = ‘?logincode=%s’ % tokenTool.setToken(userId)

    http://myplone/supersecret%s’ % logincode

  2. Send url with logincode to user

The user can use the token only once and it’s valid for three weeks. The expiration time can be set in the tool.

Safety

Why not let users login themselves instead of using this plug-in? In specific cases it’s usefull to auto-login the user. For example; a member participates in a program to save energy and keep track of his energy usage. Every month he receives an email to auto-login and updates his usage. Another example; a portal is used for informing members of newly published newsletters, these letters aren’t public. The member get’s a link with auto-login to the newsletter so he can read it.

It’s all about making it easier for the user and there’s no obstacle to login. In above cases the members are normal users with no elevated rights. Ofcourse there could be cases where a one time token is not usefull and/or safe.

The logincode that is included in the url contains the loginname and the token in base64. Every token is a uniquely generated md5 hash of random data and can only be used once. If there’s is a succesfull match between the given username, token and the stored token with username you’re authenticated.

Clearing old tokens

Old tokens can be cleared bij calling clearExpired on the token storage. Using crontick and cron4plone this job can be automated.

Add this call in cron4plone: portal/onetimetoken_storage/clearExpired

Todo

  • Some doc or unit tests would be nice

  • Control panel for setting expriation time.

  • Checking a member is disabled when generating a token. This is because we had performance problems with generating large amounts of keys (> 15,000) and SQL PAS. Add this as an option in the control panel.

Changelog

0.1 - Unreleased

  • Initial release

Release files for Products.OneTimeTokenPAS 0.1dev-r84263

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Products.OneTimeTokenPAS 0.1dev-r84263
File Size Uploaded
Products.OneTimeTokenPAS-0.1dev-r84263.tar.gz 8.2 kB Details

Release files / Products.OneTimeTokenPAS-0.1dev-r84263.tar.gz

Download URL Products.OneTimeTokenPAS-0.1dev-r84263.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0c83486b01f75b0f1765deaee772c2eec288e65fe9459dfc7d13a7b2833b126b
BLAKE2b-256 checksum
How to use checksums
63aa3524cb856292a35a1781d21b75cc69d3b10c76acdeaa8464e4b3cb1da986
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.3

1 release file

0.2

1 release file

0.1.1

1 release file

0.1

This release

0.1dev-r84263 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page