simulacrum icon indicating copy to clipboard operation
simulacrum copied to clipboard

Ability to specify domain for the custom simulator

Open taras opened this issue 2 years ago • 4 comments

Discussed in https://github.com/thefrontside/simulacrum/discussions/250

Originally posted by bstiffler582 January 12, 2023 When trying to containerize the auth0 simulator and run it separately from my app, I need to be able to reference the service with a domain other than "localhost". It seems as though the meta data returned from e.g. "/.well-known/openid-configuration" is hard coded as "localhost". Does the tool provide a means to change this value? I need to return something like: {"issuer":"https://host.docker.internal:4400/"... } or "https://auth0sim.local:4400, etc. otherwise my app container will be referencing itself. I believe this is the last piece I need, unless I am (quite likely) missing a bigger picture here...

taras avatar Jan 12 '23 20:01 taras

@bstiffler582 it looks like it's currently using the service URL. Would it make sense to use the auth0 domain instead?

taras avatar Jan 12 '23 20:01 taras

@taras to clarify - are you referencing the auth0 "audience"? Or perhaps the simulation server url? Those are the only two urls supplied when creating my simulator. Is there another property that is specifically the "auth0 domain"?

bstiffler582 avatar Jan 13 '23 01:01 bstiffler582

@bstiffler582, you're right; it returns the auth0 domain when you start the service. There are a few different ways to run the simulator. Which instructions are you using to containerize the service?

taras avatar Jan 13 '23 01:01 taras

I am using the node:13-alpine docker image and essentially just the typescript example from the auth0 README. There are some extra steps for handling certificates, but that is outside the scope of this issue.

bstiffler582 avatar Jan 13 '23 13:01 bstiffler582