Integration testing with auth0

Please include the following information in your post:

  • Which SDK this is regarding: @auth0/auth0-spa-js
  • SDK Version: 1.17.1
  • Platform Version: 16
  • Code Snippets/Error Messages/Supporting Details/Screenshots:

Auth0 Monitoring log error:
Callback URL mismatch. http://localhost:9000/?wtr-session-id=DHsFEOogFcd6wA-txqpom is not in the list of allowed callback URLs

Is this a feature request or bug report? Neither. It’s a question.

I’m currently trying to implement full integration testing in a system that uses auth0 for authentication/authorization. As a result, I’m trying to login and redirect back to the tests being run. I’ve added http://localhost:9000 to my test application for allowed redirects but the test runner auto-generates id’s appended to the url path which causes the error shown. So, my questions are:

  1. Is there a way to specify a regex in allowed callback urls or some way to specify that all connections from a particular host and port should be allowed? I’ve tried using a wildcard for the url path in the auth0 management console but that doesn’t seem to be recognized.

  2. If this isn’t possible, are there any others methods that can be used to successfully automate login for integration testing?

Hey there @hayden.mcparlane welcome to the community! Where did you land on this?

Unfortunately, wildcards for url paths are not supported as you’ve noticed - Only subdomain wildcards are.

While we don’t have any specific recommendations in this case, you can find our general tips on testing here:

Wish I could be of more help!

This topic was automatically closed after 9 days. New replies are no longer allowed.