Generate Authentication Token by default
-
Hello there,
I have a use-case, where I want for each new user, to always generate an Application Authentication Token.
How can I configure FusionAuth do that automatically?
In other terms, how can I configure FusionAuth to change the default value of generateAuthenticationToken to true?And if it is not possible yet, is it possible to generate it in a programmatic way from the client-side (a Vue app just after user logged in) without exposing an API key?
So in other terms, is it possible for a logged in user to register once again with the parameter generateAuthenticationToken? -
How can I configure FusionAuth do that automatically?
This is not possible through FusionAuth configuration. Feel free to file a feature request: https://github.com/fusionauth/fusionauth-issues/issues
You can update a user after they are created to specify an application authentication token. So you could register a webhook and listen for registration events and then update the user who just registered: https://fusionauth.io/docs/v1/tech/apis/registrations/#update-a-user-registration
And if it is not possible yet, is it possible to generate it in a programmatic way from the client-side (a Vue app just after user logged in) without exposing an API key?
Nope, you'll need some server side code or you'll need to expose an API key. You could limit the API key to only be able to update users, but you would need to make an API call to update the user and generate the auth token.
HTH.
-
@pierrot-corbel said in Generate Authentication Token by default:
generateAuthenticationToken
You can set
generateAuthenticationToken
equal totrue
in your code.So if I understand - I think what you're asking for is - each time a user is created in the UI by an admin user, or by FusionAuth as part of a login workflow using Facebook, Google (etc), and any other path to create a User Registration that is not explicitly done by using the User Registration API? Or perhaps even setting a global default so you do not have to set this API request parameter.
-
Great, thanks a lot
I will indeed use a server-side function with an API token which will be called from the user.create webhook