Auth0 Home Blog Docs

Is it possible to store pdf files in user profile metadata?

pdf

#1

I wanted to store an associated PDF file as metadata in the Auth0 user profile. The string from PDF is too long and registration fails with an error “413 Request Entity Too Large”. What is the best solution to associate a PDF file with the individual’s account?


#2

The metadata storage made available in association with the user profile is not suitable for such scenario. You need to store the necessary files in separate storage and at most associate some identifiers/flags to the user profile in Auth0 in order to map a given user to the respective files and also to know if the user completed their consent process. Off the top of my head I would point to Amazon S3 as a possible storage for those files, but this is not in any way a strong recommendation of S3 as any other similar service from another provider would likely meet the requirements.


#3

You should probably just store a reference to a file, e.g. file id or url/path etc within the user metadata.


#4

so, you’d suggest a flow like this? :
https://auth0.com/docs/integrations/aws/tokens

The initial problem is that we don’t want to give all Auth0 accounts individual ability to access AWS resources as AWS token holder. So, that must mean we have to work-around it with IAM rules for delegating read access – right?


#5

so, you’d suggest a flow like this? :
https://auth0.com/docs/integrations/aws/tokens

The initial problem is that we don’t want to give all Auth0 accounts individual ability to access AWS resources as AWS token holder. So, that must mean we have to work-around it with IAM rules for delegating read access – right?


#6

The mention to S3 was just an example, the important part is that the binary data is not suitable to be stored in the metadata and that, like the other answer mentions, you should store just an identifier reference to the file. Your own backend can manage access to that file so end-user should not require direct ability to modify the storage.


#7