engines/adva_user/vendor/plugins/authentication/lib/authentication.rb
def assign_token(name, expire=3.days.from_now)
      self.class.token_modules.each do |mod|
        token = mod.assign_token self, name, expire if mod.respond_to? :assign_token
        return token if token
      end
      nil
    end
# Will create a new token that can be used to login without a
# password (or basically you can consider this just a really
# complex password). If this token is passed into the authenticate
# method then true should be returned. This method takes the
# following three arguments:
#
# name:: Depending on the token modules used will determine if this
# argument has any meaning. Sometimes a token module will only
# respond to one name. Other times it will respond to any name.
# The reason for this parameter is to allow a token module to
# have multiple tokens it accepts so that it can then later revoke
# only some tokens if needed. For example a site trying to provide
# single-signon service may give out a token for each foreign system
# that interacts with it. Then later when that token is used the
# token module can note what system it authenticated for and if at
# some point it stops trusting the foreign system it can revoke
# that token without revoking the other tokens it has assigned.
#
# An expiration date can also be given although not all token
# modules will do anythign with this expiration date.
#
# NOTE: If the token generated is attached to the model (default
# behavior) then the token may not actually valid until the model
# has been saved. To be sure always call save after getting a new
# token if you want to be sure to keep that token.
Will create a new token that can be used to login without a
password (or basically you can consider this just a really
complex password). If this token is passed into the authenticate
method then true should be returned. This method takes the
following three arguments.

: Depending on the token modules used will determine if this
argument has any meaning. Sometimes a token module will only
respond to one name. Other times it will respond to any name.
The reason for this parameter is to allow a token module to
have multiple tokens it accepts so that it can then later revoke
only some tokens if needed. For example a site trying to provide
single-signon service may give out a token for each foreign system
that interacts with it. Then later when that token is used the
token module can note what system it authenticated for and if at
some point it stops trusting the foreign system it can revoke
that token without revoking the other tokens it has assigned.

An expiration date can also be given although not all token
modules will do anythign with this expiration date.

If the token generated is attached to the model (default
behavior) then the token may not actually valid until the model
has been saved. To be sure always call save after getting a new
token if you want to be sure to keep that token.
Will create a new token that can be used to login without a password ( or basically you can consider this just a really complex password ) . If this token is passed into the authenticate method then true should be returned . This method takes the following three arguments . : Depending on the token modules used will determine if this argument has any meaning . Sometimes a token module will only respond to one name . Other times it will respond to any name . The reason for this parameter is to allow a token module to have multiple tokens it accepts so that it can then later revoke only some tokens if needed . For example a site trying to provide single - signon service may give out a token for each foreign system that interacts with it . Then later when that token is used the token module can note what system it authenticated for and if at some point it stops trusting the foreign system it can revoke that token without revoking the other tokens it has assigned . An expiration date can also be given although not all token modules will do anythign with this expiration date . If the token generated is attached to the model ( default behavior ) then the token may not actually valid until the model has been saved . To be sure always call save after getting a new token if you want to be sure to keep that token .
def assign_token(name, expire=3.days.from_now)
      self.class.token_modules.each do |mod|
        token = mod.assign_token self, name, expire if mod.respond_to? :assign_token
        return token if token
      end
      nil
    end
def assign_token ( name , expire = 3 . days . from_now ) self . class . token_modules . each do | mod | token = mod . assign_token self , name , expire if mod . respond_to? :assign_token return token if token end nil end
Will create a new token that can be used to login without a
password (or basically you can consider this just a really
complex password).
Will create a new token that can be used to login without a password ( or basically you can consider this just a really complex password ) .
name
expire
days
from_now