App_metadata property missing when using specific Application login

We have configured a new application (“Application A”) in our Auth0 tenant. We want to use this application for authenticating users coming from a specific website.

We have app_metadata defined for the users with 3 properties like this:

app_metadata: {
	test_metadata1: 12345,
	redirectUrl: 'string-value-of-redirect-url',
	test_metadata2: 'test_value'
}

We have a post login action that uses this metadata. This works fine in the Default App.

However, when we specify a login using the client_id for Application A, e.g.:

https://{Auth0tenantname}.auth0.com/authorize?response_type=code&client_id={applicaiton-A-client-id}&redirect_uri=http://localhost:3000&scope=openid%20profile%20email

The login action does not recognise the redirectUrl property from app_metadata. It does recognise the other properties, however. The debug output for the app_metadata object is:

app_metadata: {
	test_metadata1: 12345,
	test_metadata2: 'test_value'
}

…with redirectUr completely omitted.

redirectUrl is not listed as a restricted property name here: Metadata Field Names and Data Types, and also works fine when we don’t specify a particular application.

Is there a reason why this property would be omitted only when we specify a client ID in the authorize URL?

Hey there @d.faulds welcome to the community

Sorry for the delayed response here :confused: Are you still seeing this issue? I just tested in my own environment setting the following app_metadata and was able to log all 3 values successfully via a Post Login Action:

{
  "redirectUrl": "string",
  "test_value1": 12345,
  "test_value2": "string"
}

Thanks for the response @ty.frith

We had a call with support and it turned out to be a timing problem with setting the property in an earlier post-login action.

We resolved it with a null check in the earlier action.

Ah, gotcha! Glad you were able to get it resolved and thanks for responding here