What is the syntax for wildcards in the callback url?

4

Assuming it is an option, is there a syntax for wildcards for the callback url?

For development, we have multiple web clusters, with different urls for different branches of development of our website. They all have the same domain name, but different sub-domains.

https://cool-feature-1.example.com/
https://that-one-thing.example.com/

We deploy these clusters via CloudFormation and CodeDeploy.
CloudFormation AWS::Cognito::UserPoolClient does not include a callback url option.

I attempted to put a callback url of https://*.example.com/ but that failed with an error about using the wrong redirect when the redirect_url was https://cool-feature-1.example.com/

Or is there a different solution?

demandé il y a 6 ans4493 vues
10 réponses
2

Any progress / ETA in this?

We are using multiple subdomains for different environments and tenants. Wildcard support would be highly appreciated

répondu il y a 10 mois
1

I'm using cognito for openid connect auth.
If user opens a page and needs a login, I'd like him to be redirected to the same page after login. so my callback url is

http://xxxxxxx/auth?target=somepage.html

the base url is same but with different target parameter.
is there any way to do it?

rinick
répondu il y a 5 ans
1

You can use the "state" parameter to pass the information about the page you want to redirect the user to. Cognito will pass the state value to your callback endpoint.

tomaszj
répondu il y a 5 ans
1

Hi,

We have created a feature request on this and have put that on our road map. However, we don't have any ETA yet on this but please be assured that we are working on the same.
I kindly request you to keep an eye on AWS what’s new[1] page and AWS blogs[2] to get information regarding the updates on the above as well as for recent updates on other AWS services.
[1] https://aws.amazon.com/new/
[2] https://aws.amazon.com/blogs/aws/

AWS
répondu il y a 3 ans
1

Callback URL wildcards still aren't there. Could you shed some light on the state of affairs?

Pisec
répondu il y a 2 ans
0

We do not support wildcard callback URLs due to security reasons.

Regarding adding the callback URL option in CloudFormation AWS::Cognito::UserPoolClient, we have heard this request from customers and we will try incorporating in our future releases.

AWS
répondu il y a 6 ans
0

I think we can use wildcard for subdomain without security risk if someone wanted to. Let's say example.com is the domain then callback URL would be something like: https://*.example.com/oauth2/idpresponse

répondu il y a 3 ans
0

@sarthak-AWS - agree this would be a competitive edge / unique feature for Cognito - branch deploys are super common now but no one can authenticate them without loading new urls every time.

jpapi
répondu il y a 3 ans
0

I second that, and that's exactly what we do for our deployments, they all go uder a sub-domain and then I have to manually add the url each time. Would be amaxing to have a wildcard since the domain used is our own *.abcdecompany.com would be perfect to take the manual step out of the deployment process.

répondu il y a 2 ans
0

What I find most humorous about this is that this is where Amazon draws the line of "We have to adhere to the spec". They can't even adhere to the actual Oauth spec dealing with Nonces. Entire branches and fixes are applied to react projects (next.js / next-auth) to support the fact that they're ignoring that part of the OAuth process, but they'll be super opinionated about client redirection.

répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions