AWS amplify authentication, enable only sign in - not sign up - authentication

From all the great tutorials I looked for of how to add an auth module for a react app in amplify. The only type of module I see is a complete feature of sign in + sign up.
What I'm trying to achieve is:
Set up a custom Cognito user pool and add users to the pool manually.
Add custom sign-in/login UI + code to a react amplify app.
Disable anyone but me to add new users to the Cognito user pool manually.
The website I'm working on is an internal website and I don't want anyone to be able to sign up via AppSync or the react client.
Please help :)

This won't be very difficult - you simply don't implement the front-end functionality to add a new user. Then, in your Cognito user pool config, there is an option User sign ups allowed? which you would set to Only administrators can create users.
Edit: Also, consider using the hosted UI, it may save you some front-end work.

Related

AWS Cognito with social login Google, Facebook, Apple and react native

I'm working currently on the implementation of social login using react-native and aws cognito. For now, it's working well (with or without amplify), but the issue is that I have to open a webview using the cognito hosted UI, which redirect directly to Google / Facebook / Apple. So basically, when the user click on the google signin button, there is a messagethis kind of message "myapp wants to open amazoncognito to connect...". As a user experience, it is quite mediocre, so I am wondering if it is possible to implement a different signin flow so not to redirect to an external url.
I have tried the implemntation with react-native-google-signin, but in that case, I have to use aws federated identities instead of my user pool (typically, the gogole signin retrieve an id token that can be pass to cognito federated identities). So I do not really like that solution...
I don't know exactly the process of signing up with a social login provider but if someone has ever met the issue and found a user friendly way to implement it, I am obviously interested in the solution ! (One option would be to figure out how to use the IdToken generated by Google to sign the user in my Cognito user pool, the other would be to directly use an iframe to open facebook, google, apple, so at least the message would not appear).
Thank you for you help !

How to enable email and password signin provider for new firebase project using gcloud console or firebase tools CLI?

In the company I am working for, we provide a solution for other companies, and we want each company to have a separate instance of that solution, this includes a separate database instance, the database is Firebase, this choice of creating a new separate instance is required due to data privacy laws of the country we work in.
I am working on a script that when triggered by the new client SignUp, it starts the creation of new solution instance, including the creation of the new Firebase project, and I am using firebase-tools CLI and gcloud CLI.
The project creation happens correctly, and the admin account is created, the only remaining thing is to allow the admin to be able to login to the new Firebase project. This is usually done manually from the Firebase web console, by enabling a login provider, an Email&Password login provider in my case. This part of the process is so not automated, because I can't find the command that I should pass to Firebase-tools or gcloud ClI to enable a login provider in a Firebase project.
What is a command that you can pass to Firebase tools or to gcloud CLI , to change firebase project confguration to enable a signin provider ? signin usng Email&Passsword in this case .. Or is there a way to do it programmatically using Google client libraries ?
From looking at the REST API for the Google Identify Platform, I don't immediately see a call that shows email+password authentication. Unless I'm overlooking something this means it might not be possible to programmatically enable this provider through a public API.
From checking what the Firebase console does, it seems it handles the provider configuration through the https://identitytoolkit.clients6.google.com/admin/v2/projects/<projectid>/config endpoint, but I'm not sure that is part of the public API.
This seems possible now via Identity Toolkit API. The v2.projects REST resource has updateConfig method, and the Config contains SignInConfig which have the Email property.

Auth0 Authentication API with React Native

I am currently developing a mobile app in react native and using Auth0 for user management. I am using my own login, signup and forgot password screens instead of their lock widget. I was able to implement passwordless sms and email by calling their authentication api as well as account linking by using their management api. However, I am having difficulty authenticating in a user with their email and password through the api once they already have an account. It seems to me that there should be a single endpoint for this in which you include the email and password in the body of the request. I was wondering if anyone could help me understand how to simply login users using auth0's api. Thanks in advance.
Take a look at this react native (embedded login custom UI) sample (slightly dated) - wrote it around 6 months ago, but it should offer you good insights - https://github.com/auth0-samples/react-native-embedded-login
Sign in logic is here
Feel free to leave questions below.
For anyone who is still looking there is this step by step on their website on how to login with password via API: https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-resource-owner-password-flow
And with this endpoint you can register a new account: https://auth0.com/docs/api/authentication#signup

Persisting unauthenticated user on AWS Cognito and AWS Amplify with React Native

I'm trying to implement AWS-Amplify in a React Native app so that events can be sent to Pinpoint for analytics. A user doesn't need to be signed in to use the app, so they would be unauthenticated with Cognito.
I am noticing that the identity of the unauthenticated user doesn't seem to persist, so when I close or uninstall the app, a new identity id is generated when I launch the app. The docs suggest that this should be cached, but it seems the cache is clearing out when using AWS Amplify.
Is there a way to set or reuse an identity id for a returning unauthenticated user on AWS-Amplify or Cognito so new identity ids don't get assigned ?
I looked through amazon-cognito-identity-js to see if there was a way to do this with an unauthenticated user and wasn't able to find what I am describing: see here.
I'm new to AWS Amplify/Cognito/Pinpoint in general, so any thoughts or suggestions to do something similar would be greatly appreciated!
This is a known issue in the AWS Amplify and should have been fixed in the latest version.

Is there a way to get the "remember me" checkbox work on Azure Mobile Service authentication for WinRT apps?

I'm trying to add Azure Mobile Service authentications to my WinRT app. I got everything working and I can sign in with all the 4 social media accounts(Facebook, Twitter, Google and Microsoft Account). But when I close the app and restart it, I have to write my user name and password even if I check the Remember Me button on either one of the options. Let say I logged in with my Facebook account, what I want to achive is, when I restart the app and click Login with Facebook, it shouldn't ask my username and password but automatically authenticate me. The remember me button seems to not working. Is there a way to achive this?
Thank you for the answers.
Edit: I'm using C#/XAML for my my app.
The following blog post covers caching the user's identity. http://www.thejoyofcode.com/Setting_the_auth_token_in_the_Mobile_Services_client_and_caching_the_user_rsquo_s_identity_Day_10_.aspx
According to this page: http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-users-dotnet/
Note
... This method is easy to configure and supports multiple providers. However, this method also requires users to log-in every time your app starts. To instead use Live Connect to provide a single sign-on experience in your Windows Store app, see the topic Single sign-on for Windows Store apps by using Live Connect.