Address validation at the time of user input - java

I have a signup from where user need to input their address with pin and city. All are text fields.I want to validate those address given by the user.
Means if a user given some wrong address then an error message will prompt saying address is not valid.
Is there any API so that I can validate the address before user data save on the database.
I am going through this link :
https://developers.google.com/maps/documentation/geocoding/get-api-key
but it was not free.
After lot of searching I can see that from smartystreets.com we can check if a address is valid or not.
But it is paid service and for free service only '250 hits' is eligible per month.
But when I try to call the api from postman I am not getting any response.
API Link:
https://smartystreets.com/products/apis/international-street-api?auth-id=a9e4cd62-78df-be45-5575-65efdb06edf5&auth-token=7YEnKXJD7h20yHDfOfra&country=India&address1=DLF2%20Building&locality=Newtown&postal_code=700056

You can try the Geocoding API by google ,you can pass the address to it and if the address is valid then you will get valid geocordinates else not and you can use it as a bypass trick.
Here is the link GEOCODING API by GOOGLE

Related

Azure blob refuses to upload a document

Caused by: com.azure.storage.blob.models.BlobStorageException: If you are using a StorageSharedKeyCredential, and the server returned an error message that says 'Signature did not match', you can compare the string to sign with the one generated by the SDK. To log the string to sign, pass in the context key value pair 'Azure-Storage-Log-String-To-Sign': true to the appropriate method call.
If you are using a SAS token, and the server returned an error message that says 'Signature did not match', you can compare the string to sign with the one generated by the SDK. To log the string to sign, pass in the context key value pair 'Azure-Storage-Log-String-To-Sign': true to the appropriate generateSas method call.
Please remember to disable 'Azure-Storage-Log-String-To-Sign' before going to production as this string can potentially contain PII.
Status code 403, "AuthorizationFailureThis request is not authorized to perform this operation.
I have tried uploading a document to azure blob.
I have resolved this issue by adding my client IP Address in Firewalls and Virtual Networks.
If you are facing a similar problem you might not have access for reading or writing in the Azure blob.
All you need to do is open the Azure Resource group -> Storage account -> In the Security + networking section you have an option called Networking -> In the Firewall section you can see an option called Add your client IP address, you can check that check box and save your changes.
That's it you'll get access to read or write the blob storage after that.

How to fetch user's age and location while doing google signin

I am integrating google signin in my app.I need to store email,name,agerange,location.So while doing signin, i have set the scope to profile,email and profile.auth.agerange.read.
gapi.signin2.render('g-signin2', {
'scope': 'email profile https://www.googleapis.com/auth/userinfo.profile openid https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/profile.agerange.read',
'width': 240,
'height': 50,
'longtitle': true,
'theme': 'dark',
'onsuccess': onSuccess,
'onfailure': onFailure
});
But still when i am verifying the generated id_token using GoogleIdTokenVerifier i can't see age or location field in the payload.
Can anyone suggest how to get those details.
Most likely location and age group wouldn't be provided with a basic payload.
And you would be needed to call an additional API(s):
GET v1/people/me?personFields=ageRanges with https://www.googleapis.com/auth/userinfo.profile scope;
GET v1/people/me?personFields=birthdays with https://www.googleapis.com/auth/user.birthday.read scope.
Also, take a look into get-user-info-via-google-api topic.
https://developers.google.com/identity/sign-in/web/people
https://developers.google.com/people/api/rest/v1/people#agerangetype
You can also get dob from api and calculate the age of the user.
location string can also get from the rest api response from google.

Find a JIRA user by e-mail address with JIRA REST API

I'm using JIRA REST API for accessing JIRA from a third party application.
I'm trying to find whether a user account exists in JIRA for a particular e-mail address. The same is working for user name but not for e-mail address.
Could you please let me know how to do it? I have gone through this documentation.
According to the document you linked, the REST call
api/2/groupuserpicker
searches by username OR email address.
parameter type description
------------ ------- --------------------------------------------------------
query string A string used to search username, Name or e-mail address
If it's not working with an email address then you should be submitting a support request to Atlassian.

User Name in Spring Send Mail API

How to pass the different user name instead of displaying the from email name in mail received to the end user java send mail API.
Atleast you can google first for your question. Anyways refer this.

How do I retrieve the email address associated with a session token from the Google Data / Google Contacts API? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How does one retrieve the email address of a user with GData?
Using the GData Java client (http://code.google.com/p/gdata-java-client/), I create an authsub request URL by using AuthSubUtil.getRequestUrl(). I then exchange this for a session token using AuthSubUtil.exchangeForSessionToken() which all works fine. (Using "http://www.google.com/m8/feeds/" as the scope for Contacts)
I can see in the examples and Javadocs how to go about getting the contacts for this session token, but I can't seem to figure out how to get the email address that's just been authenticated.
Some of the wording in the documentation makes it seem like this is intentional (to be unable to retrieve that user's login information) but that seems like a gaping hole in functionality to me?
Google intentionally hides login information in all of its APIs, which includes the user's email address.

Categories