How can I have a user confirm their credentials from within a Capacitor project? - capacitor

I have a Capacitor project and want to be able to guard an action (sending another user money) by first requiring the user to confirm their credentials (PIN / fingerprint / face). I'm thinking what I need to make use of is createConfirmDeviceCredentialIntent on Android and its equivalent on iOS. How can I do that?

Related

Convert a text to voice recording and then play it after calling a phone number on Flutter

I'm trying to make an app which gets the location of a user and then call a number(pre-selected by user) to send a recorded voice message, like say "Location is {longitude} degrees, {latitude} degrees" but I can't find anything to do the same I found Twilio on some searching but in the Flutter package twilio_voice I can't find anything to do what I want.
So my question is can this be done in Twilio and if not what else I can do?
(Edit :I have figured out the part to fetch the user location and just display it on the screen, the part that remains is to convert this to speech and play on call)
You can achieve this with Twilio, however you will need a server from which to make the requests to the Twilio API. To make an API call to Twilio you need to use your Account SID and Auth Token and if you were to embed those within your Flutter application then a malicious user would be able to decompile your app, steal your credentials and abuse your account.
So, the best way is to build a server-side application that can make the API calls on behalf of your app and then send the relevant data (the location, in this case) from your mobile app to the server application.
On the server-side application, once you receive the location data you can generate a call by calling on the Twilio calls resource and pass the number you want to call, the number you are calling from and the TwiML you want to execute on the call. TwiML tells Twilio what to do on a call, and in this case you can direct Twilio to <Say> the message with the location.
I see you've asked python questions in the past, so here's a quick example of calling the Twilio API to create a call in python:
import os
from twilio.rest import Client
# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.environ['TWILIO_AUTH_TOKEN']
client = Client(account_sid, auth_token)
call = client.calls.create(
twiml='<Response><Say>Location is {longitude} degrees, {latitude} degrees</Say></Response>',
to=TO_NUMBER,
from_=YOUR_TWILIO_NUMBER
)
print(call.sid)
You need to divide your problem into smaller subproblems and test if the native OS (Android / iOS) allows you this:
Fetching current user location
Create an audio file with a text-to-audio speech generator
Research if it's possible to make calls programmatically (this might be tricky)
Make a phone call
Research if it's possible to play audio file while in call
Play an audio file on speaker while incall

mobile PIN based authentication for mobile app

I need to build a mobile app where i need to first register a user by phone number followed by setting up a 4 digit PIN. Next time when user logs in user can directly input the set 4 digit PIN and logs in on the app.
How can i implement it with spring security?
My thought is, when user registers with his/her phone no + PIN then do i need to keep this combination in Spring token store or an IDP like keycloack so that when user opens the app again then i can do a check in db if the device is registered in the db (with IMEA no) with mpin set up then show the PIN screen to input? In this case, will PIN be a part of IDP then which field in IDP should hold PIN? like password or something..?
can you pls give me some direction around this.
Flutter package : local_auth: ^1.1.11
The authenticate() method uses biometric authentication, but also allows users to use pin, pattern, or passcode.

How can I add cc user via flutter client side. (Not using web console)

I'm trying to use cunnectycube for our flutter(+ firebase) app that is chat application and I want to add audio call function.
How can we add cc user via client app?(or cannot?)
Cuz I want to add cc user by using firebase user(more than 8000)
If we cannot via client app like API, should I add manually one by one?
thanks.
you don't need to create them manually, ConnectyCube Flutter SDK has API for it. Use function signUp for it.

Sorry, this action is not available in simulation

My test invocation name is "Mrs Tang", so i input "Talk to Mrs Tang", but it responds "Sorry, this action is not available in simulation"...
Does anybody know How can I resolve this error?
According to the doc:
Turn on the Web & App Activity, Device Information, and Voice & Audio
Activity permissions on the Activity controls page for your Google
account. You need to do this to use the Actions Simulator, which lets
you test your actions on the web without a hardware device.
And I had do what Jeremy Gordon suggested. To add a second google account in the GCP IAM console with a viewer action permission and then login with this second google account in an incognito window for the web simulator to work.
I had a related problem (I could test with my main developer account, but not my test credentials). I eventually got it working with the non-primary account.
The missing link for me was that when I was viewing the simulator, I was actually signed in to two accounts, my primary google account (developer account, shows up in the main frame of the page, upper right corner), and the account I authorized when 'starting' the simulator (email address shows up in the simulator frame), which was my test credentials. The second test account repeatedly gave me the "Sorry, this action is not supported in simulation" message, until I:
1) Added the test account as a Conversation API Viewer & Client in GCP IAM console
2) Visited the 'create link' (the one that comes up when you click share) in an incognito window, and signed into the secondary account there such that I was signed into only one account in that incognito window.
After that, invocations connected to the app.
Make sure you are logged into the same account you used to deploy the test action and that the deployment has been done within the past half hour or so. If you have not set all the information on the Actions on Google Console, you may need to use the invocation phrase "Talk to my test app".
I think sometimes I run into the same error. I get past it by toggling the Active switch off and on.
Same problem I encountered. You must be logged in via the secondary google account. Do logout from the account and login via the account that is paired with api.ai.
why I can't use google action in web simulator
I got this to work by saying "talk to my test app" or typing it in to the simulator prompt, that triggered my app to start in the simulator.
I had the same problem. I needed to set the location first (it defaults to Google-Headquaters), if you are in some other region (like in germany as i am).
Then go on with "Mit meiner Test-App sprechen" (Talk to my test app), or whatever it is in your language!
I did not get this message on my invocation, but on my my second input:"Sorry, this action is not available for your app.".
It turns out the simulator had left the conversation right after the invocation (and it did mention that in the small print).
This happened because I returned a FinalResponse for the invocation. And a final response is pretty final, it will terminate your conversation.
So, after a FinalResponse you can only get back in your action/conversation by a new invocation or a deep link. If you want to suggest questions/inputs, then you should return ExpectedInputs.
You might need to turn on Web & App Activity to let group members use some Google Assistant features.(if you are using organizational account)
https://support.google.com/assistant/answer/7219584?hl=en
If you are using any organization's Google Accounts then there might be an access issue. So use your own personal Gmail account.
Take a look here, organization's might not be given you access. So use your personal Gmail and follow the Docs, you will able to create your agent/ actions and able to test it with simulator as well as in android device.
At time of testing the Google Action you need to set the location to the country which you selected while developing or submitting your Google Action.
By default US is selected in testing but if your action is for one particular country only then you need to select that. You can see in image the field where you can select location

play framework 2 securesocial login form - email registration process

I'm currently using securesocial out of the box where the registration
process is
submit email
respond to email verification
enter user details, name etc and automatic login after submitting user
details
next time login with user name
But my users would prefer a more streamlined two step process
submit user details, name, email, etc. (don't use captcha)
respond to email verification and login automatically
next time login with email (I can use withUserNameSupport=false for
this)
The password reset/change process is great and won't change.
Can secure social do this?
Are there any examples I can use?
Thanks
Peter
Using scala 2.10, Play 2.2.2, secure social 2.1.3
The module only has the sign up flow you are using.
In versions 2.1.x changing the default flows is not that easy as the controllers were objects and you could not remove the default routes without getting errors. You can add your own controllers with the custom flow though.
Using master (what will become 3.0) you can disable the module routes as needed and add your own or extend the default controllers (since they are traits now) and change things more easily.