# SignToken

**URL:** <https://www.ruby-forum.com/t/signtoken/77443>\
**Category:** Engines Development\
**Created:** [March 6, 2006, 9:12pm UTC](https://www.ruby-forum.com/t/signtoken/77443 "2006-03-06T21:12:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nelson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/dec6dc/32.png) [@nelson](https://www.ruby-forum.com/u/nelson)\
**Post date:** [March 6, 2006, 9:12pm UTC](https://www.ruby-forum.com/t/signtoken/77443/1 "2006-03-06T21:12:28Z")

</div>

hi,  
I’m working in extending the login engine to use a signed token to login  
in addition to user and password.  
The idea is that a random token is presented, the user click the ‘sign &  
login’ button, choose the  
certificate to use (X509 Certificate), sign the token and present it to  
the login engine, validate it and if all is ok, you are logged in…  
At this time a proof concept is working with Firefox 1.5 and the changes  
in the LoginEngine are little and integrate very well.  
I have two questions about the LoginEngine at this time:  
1- LoginEngine don’'t have a :login\_page config like UserEngine to  
change the default page, but UserEngine don’t have a ui to login, that  
LoginEngine have… why this option is in UserEngine and not in  
LoginEngine ??  
2- I need a couple support functions (generate random tokens, signature  
validation, etc), where is the best place to put then ?

## TIA

:: Nelson ::

---

<div class="post-metadata">

**Author:** ![nelson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/dec6dc/32.png) [@nelson](https://www.ruby-forum.com/u/nelson)\
**Post date:** [March 23, 2006, 2:30am UTC](https://www.ruby-forum.com/t/signtoken/77443/2 "2006-03-23T02:30:06Z")

</div>

On 3/6/06, nelson [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have two questions about the LoginEngine at this time:  
> 1- LoginEngine don’'t have a :login\_page config like UserEngine to  
> change the default page, but UserEngine don’t have a ui to login, that  
> LoginEngine have… why this option is in UserEngine and not in  
> LoginEngine ??

The LoginEngine represents the minimum amount of work to transform the  
SHLG into an engine, and as such leaves something to be desired in  
terms of it’s design. The UserEngine in particular _needs_ to know  
where the login page is because it has a more sophisticated ‘nu-uh you  
can’t do that unless you’re logged in’ mechanism, but also because it  
was developed with a bit more freedom than the LoginEngine.

The short answer is that there is _no_ good reason for this, and  
future versions may correct this.

> 2- I need a couple support functions (generate random tokens, signature  
> validation, etc), where is the best place to put then ?

Probably in the AuthenticatedSystem module…

- james

–

- J \*  
~
