Announcement Announcement Module
No announcement yet.
Creating a token for email activation Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating a token for email activation


    I have an application that acts as both client and provider.
    There's a new requirement that when a user registers, we don't activate the account immediately. Instead, through an external trigger, the application is to send out an email to the user with a link containing a time limited, limited scope access token.

    I would have thought it would be trivial, but I can't seem to find any documentation of how to create an access token manually. I'm sure I'm just missing something.

    Any help would be appreciated.

  • #2
    Creating an access token is easy (it's an interface with a default implementation). What you need is to make sure the resource server recognizes the token when it is presented by a client, and is able to associate it with an authentication token. If you are using a TokenStore (i.e. you are using DefaultTokenServices), maybe you could just insert a new instance in there?


    • #3
      Hi Dave,

      I saw the createAccessToken(OAuth2Authentication authentication) method in DefaultTokenServices. I'm just not sure how to create the OAuth2Authentication object that I need to pass into it. This is probably due to my limited experience with the library, but I could use a hand.