AWS Build a Serverless Web Application WildRydes Authentication Error when trying to create a new account on the app - amazon-web-services

I'm working on one of the AWS build a serverless app projects. Its the project for the WildRydes unicorn rides.
Im stuck on Module 2: User Management.
Authentication Error Example
I get "Authentication Error" when trying to create a new account on the app? I followed along every step but still get this error. I even tried manually creating a group in Cognito and changing the details in the config.js file but I still get the same Authentication Error on the App.
I had tried just following along the official tutorial:
https://aws.amazon.com/getting-started/hands-on/build-serverless-web-app-lambda-apigateway-s3-dynamodb-cognito/module-2/
But I had trouble with the tutorial itself so I followed along someone's video:
https://www.youtube.com/watch?v=GPme1i1VyQQ
Is there another file that also needs to be configured? What am I missing?

In the js/cognito-auth.js file
function toUsername(email) {
return email.replace('#', '-at-');
}
Update the toUsername() function:
function toUsername(email) {
return email;
}

Related

Video streaming in react-native using custom API

I'm working on a react-native app using expo-av to show videos, and whne I put in source the uri: 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4', from google samples, it acutally works, but if I try to put a uri for a video contained in my django media folder, the following error occur:
The server is not correctly configured. - The AVPlayerItem instance has failed with the error code -11850 and domain "AVFoundationErrorDomain".
How can I solve?
Thank you

django-rest-framework-social-oauth2: error 400 - redirect_uri_mismatch

I've been trying to add google login to my django app following this tutorial:
https://github.com/RealmTeam/django-rest-framework-social-oauth2
By following exactly the instructions, everything works fine in local.
However, when I try to replicate the same on the server, I get the following error on the redirect page of the login:
Error 400: redirect_uri_mismatch
redirect_uri: http://localhost:8000/auth/complete/google-oauth2/
What is strange to me is, in my google developer console, I have set up the correct redirect url in my app, as follows:
https://mydjangoapp.com/auth/complete/google-oauth2/
And I have also put 'mydjangoapp.com' under 'Authorised JavaScript origins'.
So my question is, why google keeps telling me that the redirect url is
http://localhost:8000/auth/complete/google-oauth2/
which is not the one I have set up in the console? Perhaps there is something obvious that I'm missing here. Thank you!
Why google keeps telling me that the redirect url is
Because your application is sending its in your code the app is running on http://localhost:8000 and if you are using a client library its probably adding the rest automatically.
http://localhost:8000/auth/complete/google-oauth2/
The redirect uri must exactly match what you are sending from your application.
You need to add
http://localhost:8000/auth/complete/google-oauth2/
Javascript origin is only needed if your code is using javascript.
This video will show you how to fix the error. Google OAuth2: How the fix redirect_uri_mismatch error. Part 2 server sided web applications.
If you want your code to send https://mydjangoapp.com then your going to have to be running it from https://mydjangoapp.com probably and you may need to figure out how to configure it so that it is running from the correct host.

API Gateway Error : Site can't be reached

I followed the process from this video : here
I created the Lambda function, and the API, and when I am testing in the API Gateway editor, it is working properly. Giving status 200 and correct output.
Here when I deployed I gave the url + /opencv as said in the video, but the browser doesn't give any output and gave the result site not reachable.
I also tried without the resource /opencv and when I run the url which I get after deployment I get {"message":"Missing Authentication Token"} error.
So, how am I able to get the output while testing in the AWS tool as shown in the picture above but after deployment I am not able to get. What am I missing?
Check Your Stages under Resources and verify the URL and try to create a new stage. i just followed the same steps and i can see it is working fine. In order to reproduce, i deleted the Stage and verified it gives me the error which you have mentioned. So try to reproduce the steps again by creating a new stage under resources as it will enable you to have auto new URL and then verify. Incase if it does not work, do share your stage Screenshot next time.
For others that get the same issue. One solution is to wait a bit:
I also had this error when first time deploying the API GW. It then started working fine ~5-10min later.

HTTP 404 error while invoking a local webservice in .NET MVC4

I am trying to learn webservices in .NET mvc4. I tried creating a new Internet application and adding a Web service (asmx) to the project.
By default, the VS adds a "HelloWorld" Webservice. When I try to run it in the browser, I do get the list of operations, service description(WSDL) and the details of the HellowWorld operation. However, when I try invoking the webservice, it gives the following error :
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its
dependencies) could have been removed, had its name changed, or is
temporarily unavailable. Please review the following URL and make
sure that it is spelled correctly.
I might be missing some basic step/setting I guess. Could some body help please. Thanks.
I got the answer from one of my colleagues :) .
When we invoke the service, the MVC tries to resolve the path as specified in RegisterRoutes.
Hence it tries to find a controller with that name and a method with the name same as that of the operation inside that controller. The resolution, ignore the paths with .asmx extension. You can do that by adding the following line in RouteConfig.cs :
routes.IgnoreRoute("{*x}", new { x = #".*\.asmx(/.*)?" });
and it worked. Thanks.

recieving error The file you are attempting to save or retrieve has been blocked from this Web site by the server administrators.<nativehr>0x800401e6

After building and deploying, checked the solution management from Central administration and it's up, a simple web service method that only created a Document Library list with a few columns when trying to retrieve the wsdl or even just by calling the WS fromt the adress since its a void method I recieve some error:
The file you are attempting to save or retrieve has been blocked from this Web site by the server administrators.<nativehr>0x800401e6</nativehr><nativestack></nativestack>
The very same method runs fine when called from another web service project that is already deployed so there's nothing wrong with the code. I'm most probably doing something wrong but can't figure.
The system is running on a win server 2008 with sharepoint 2010, framework 3.5 and "ANY" cpu mode.
thank you!
[edit]
Managed to get rid of the previous error by removing asmx extention from the blocked file list in central administration now instead I'm recieving a 404 error:
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /_layouts1/my2claims/tt_claims.asmx
it must run under the same application pool as SharePoint