amazon-cognito-auth-js icon indicating copy to clipboard operation
amazon-cognito-auth-js copied to clipboard

Cognito link for UI has wrong scripts paths null/null

Open guilhermedecampo opened this issue 6 years ago • 8 comments

Hello!

When I access my link for the cognito pool login it has the wrong paths.

Take a look on the link: https://eventsuserspool.auth.us-east-1.amazoncognito.com/

and in the HTML source code:


  | <!DOCTYPE html>
--| --
  | <html>
  | <head><head>
  | <link href="null/null/css/bootstrap.min.css" rel="stylesheet"
  | media="screen" />
  | <link href="null/null/css/cognito-login.css" rel="stylesheet"
  | media="screen" />
  |  
  | <title>Signin</title>
  |  
  | <script src="null/null/js/amazon-cognito-advanced-security-data.min.js" ></script>
  | <script>
  | function getAdvancedSecurityData(formReference) {
  | if (typeof AmazonCognitoAdvancedSecurityData === "undefined") {
  | return true;
  | }
  |  
  | // UserpoolId is not available on frontend for springboard. We do not use userPoolId
  | // anyway other than put in context data.
  | var userPoolId = "";
  | var clientId = getUrlParameter("client_id");
  |  
  | var username = "";
  | var usernameInput = document.getElementById("username");
  | if (usernameInput && usernameInput.value) {
  | username = usernameInput.value;
  | }
  |  
  | var asfData = AmazonCognitoAdvancedSecurityData.getData(username, userPoolId, clientId);
  | if (typeof asfData === "undefined") {
  | return true;
  | }
  |  
  | if (formReference && formReference.cognitoAsfData) {
  | formReference.cognitoAsfData.value = asfData
  | }
  |  
  | return true;
  | }
  |  
  | function getUrlParameter(name) {
  | name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
  | var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
  | var results = regex.exec(location.search);
  | return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
  | };
  | </script>
  |  
  | <meta name="viewport" content="width=device-width, initial-scale=1">
  | </head></head>
  |  
  | <body>
  | <div class="container">
  | <div class="modal-dialog">
  | <div class="modal-content background-customizable modal-content-mobile visible-xs visible-sm">
  | <div><div>
  | <div class="banner-customizable">
  | <center>
  |  
  | </center>
  | </div>
  | </div></div>
  | <div id="div-forms" class="modal-body">
  | <div><div>
  |  
  | </div></div>
  | <div>
  | <div><div>
  |  
  | </div></div>
  | <div><div>
  |  
  | </div></div>
  |  
  | </div>
  | </div>
  | </div>
  |  
  |  
  |  
  | <div class="modal-content background-customizable modal-content-mobile visible-md visible-lg">
  | <div><div>
  | <div class="banner-customizable">
  | <center>
  |  
  | </center>
  | </div>
  | </div></div>
  | <div id="div-forms" class="modal-body">
  | <div><div>
  |  
  | </div></div>
  | <div>
  | <div>
  | <div><div>
  |  
  | </div></div>
  | <div><div>
  |  
  | </div></div>
  | </div>
  |  
  | </div>
  | </div>
  | </div>
  | </div>
  | </div>
  | </body>
  |  
  | </html>


I need to do any other configuration to make it work? Thank you,

guilhermedecampo avatar Apr 25 '18 18:04 guilhermedecampo

I just setup cognito as well for the first time, and have the same issue.

nicholasbarger avatar May 03 '18 03:05 nicholasbarger

maybe @yuntuowang can help us

guilhermedecampo avatar May 03 '18 13:05 guilhermedecampo

Hi @guilhermedecampo, I don't entirely understand your problem. https://eventsuserspool.auth.us-east-1.amazoncognito.com/ is not the correct hosted UI url. So you cannot see that page.

Complete one should be in this format: https://<domain value>.auth.us-east-1.amazoncognito.com/oauth2/authorize?response_type=token&client_id=<client id>&redirect_uri=https://www.amazon.com

yuntuowang avatar May 03 '18 18:05 yuntuowang

I have the same problem. Have configured App integration/App client settings then try to access the 'sign-in' page as:

https://<my-auth-domain>.auth.ap-southeast-2.amazoncognito.com/?response_type=code&client_id=<client-id>&redirect_uri=https://<lambda-endpoint-random>.execute-api.ap-southeast-2.amazonaws.com/dev

When I hit up this URL I get the malformed HTML page returned and a blank page.

trickidicki avatar Aug 04 '18 00:08 trickidicki

I see the same issue with https://.auth.eu-central-1.amazoncognito.com/

i.e. a blank screen and 'link href="null/null/'

However I do get good response with:

https://.auth.eu-central-1.amazoncognito.com/oauth2/authorize?response_type=token&client_id=&redirect_uri=<redirectt_url>

wozgonon avatar Aug 25 '18 16:08 wozgonon

I'm having the same issue with a custom domain. Any fix for this?

Edit: Sorry, the issue was that I was visiting the address without the query parameters. Apparently when using it with the right parameters it works fine. An example for a correct address:

https://example.com/login?response_type=code&client_id=<CLIENT_ID>&redirect_uri=<REDIRECT_ADDRESS>

samuelgozi avatar Dec 24 '18 16:12 samuelgozi

https://mydomain.auth.us-east-1.amazoncognito.com/

i.e. a blank screen and 'link href="null/null/'

However I do get good response with:

https://mydomain.auth.us-east-1.amazoncognito.com/oauth2/authorize?response_type=token&client_id=&redirect_uri=<redirectt_url>

@yuntuowang team pls help

mcabala avatar Jan 03 '19 05:01 mcabala

https://my-dev.auth.us-east-2.amazoncognito.com/login?response_type=token&client_id=7rjr&redirect_uri=https://debian.org

worked for me. Note the "login" path.

aarkerio avatar Jan 30 '19 22:01 aarkerio