I've been working on my personal project -- Spring MVC Application which integrates with AWS Cognito. I have created user pool and linked the pool to a federated identity (not using Facebook or Google to authenticate). Since the SDK that Amazon provides is for Android development in Java, CognitoUserPool is asking to add "android.context.Context" as one of the arguments. Is there any way to get context that works on Spring MVC to integrate with AWS Cognito?
You are probably using wrong SDK. Amazon provides SDK for Java and SDK for Android. Make sure, you are using the right one.
Related
I am trying to figure out what is the best practice to integrate AWS S3 in my android app.
As a pre-work I have an s3 bucket which I can upload\download\delete using the python/java SDK and now I want to implement it in my android app.
I found on the web different approaches and can not get my head straight what is the recently\correct way doing it.
My research brought the following result:
mobile hub - https://grokonez.com/android/uploaddownload-files-images-amazon-s3-android
or in the amazon offical - https://docs.aws.amazon.com/aws-mobile/latest/developerguide/mobile-hub-add-aws-mobile-user-data-storage.html
user pool\cognito -https://101apps.co.za/index.php/item/195-android-and-amazon-s3-secure-file-storage-in-the-cloud
github project - https://github.com/nimran/Amazon-S3-Integration-in-Android - when i clone and try to activate it most of the aws calls are deprect.
another amazon official, this time using Android SDK - https://aws-amplify.github.io/docs/android/storage
I am looking for a guide\repo which is up to date and explain the correct way to integrate S3 in an android app.
thx
#helpper The best way is to follow the official documentation which contains nice sample code to start, always updatated and easy to follow instead of any other sites.
For now you can follow the Android Sdk docs or the Amplify framework but the amplify framework is currently is in Preview stage which will be ready in few days.
I would recommend using Cognito Identity Pools here to generate temporary AWS Credentials (which are obtained via AWS STS). Those credentials can be further used to invoke relevant AWS S3 API calls, and thus satisfy your application development requirements.
Cognito Identity Pools support both Unauthenticated Access and Authenticated Access, so with relevant roles, you would need to select appropriate IAM JSONs for both cases, to ensure your software remains robust and secure.
Since you are developing your application on Android(with Java), I would highly recommend this official AWS documentation as your starting point.
Check the sample app: aws labs.
Build the app and customize it accordingly. Just change the settings in "aws configuration file".
Prerequisite:
Android Studio
S3 bucket
aws cognito (identity pool)
aws IAM role (identity pool role, having access to S3 bucket)
Hope this helps!
I'm trying to pass Google credentials (without service account json files) to allow my Google Cloud functions to make requests to the Google Cloud Vision Api.
One week ago I created an Java spring app engine project in the flexible container and here I was able to let my code access the Cloud Vision Api and the Cloud firestore without providing service account json files, because they run on the same project on Google cloud.
Now I'm trying to achieve the same in a Node.js project, because I'm splitting up the Java code into multiple cloud functions.
I already created a working version in Java Spring by using the following code. I have also managed to make a connection with Cloud firestore by providing a service account json file, but again not without that.
Version 1 - with service account file - Java
Credentials credentials = ServiceAccountCredentials.fromStream(new FileInputStream("path-to-json-file"));
Version 2 - without service account - Java
This version I need in my Node.js project
ImageAnnotatorSettings imageAnnotatorSettings =
ImageAnnotatorSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(credentials))
.build();
I just want the Google cloud functions that run on the same project to be
automatically authenticated for the Cloud Vision API.
I am working on a project build in java that has android frontend. Its basically and android app that calls REST APIs build in java. I have created restful apis using springmvc, hibernate and eclipse. Currently I don't have any security mechanism for these apis (e.g. authentication tokens). I want to secure my APIs through AWS APIGATEWAY. I have done some research and have successfully implemented authentication through APIKeys. But according to document it's not that secure.
My understanding of this whole process is that Cognito user pool and Lambda authorizers will only be applicable in case of implementing REST APIS in apigateway but if i want to apply security on my already created backend APIs I'll have to use API KEYS. Can anyone tell me how I should go about it?
I'm a beginner in context of google-cloud-endpoints and the associated product "google-cloud-app-engine".
I've created a simple google app angine project/application and created an API-Key by using the google cloud platform's console.
To my app-engine's endpoints API definition I've added the annotation
"apiKeyRequired = AnnotationBoolean.TRUE" as stated in
Add API restriction by adding an API key to your app engine application
and my client application which uses the generated endpoints client API was also updated accordingly to send the generated API key for all API requests.
As I would like to test the "API-Key" mechanism locally on my development machine (using a local app-engine environment) before deploying the backend to the cloud, I would like to know, whether it is possible to test the "API-Key"-restrictions locally. I mean, somehow the locally executed app-engine backend app has to be aware of the created API key. Maybe there is a property which I have to provide to my app-engine backend application's POM.xml file...I don't know, whether the google app-engine SDK supports API keys for local testing in context of the "endpoints framework v2" actually. The newley introduced API Management Platform (API-Gateway) can maybe not be "simulated" locally...?!
Thank you so far for your effort!
API key restrictions should work locally. You just need to include GoogleAppEngineControlFilter in your web.xml.
I have accomplished deploying a java web/worker role using Azure SDK for Eclipse with the help of the following site : http://dotnetslackers.com/articles/net/Developing-a-Hello-World-Java-Application-and-Deploying-it-in-Windows-Azure1.aspx
Are there options to deploy a java web/worker role using REST APIs of Azure.
Thanks in advance
Yes there is.
From this tutorial you've learned how to directly deploy your application (web role) to Windows Azure. The Windows Azure Tools plugin for Eclipse have one more option - create package. If you just create a package you can use it to later deploy it as Cloud Service (that is the web/worker role) via REST API or PowerShell cmdlets.
However the process of using REST API will be a two step process:
You upload your package to an Azure blob storage using the BLOB REST API.
Create a production deployment for your cloud service pointing the correct package URI in the blob. Do this by using the Azure Management REST API - Create Deployment operation;
Note that the REST Management API for Azure is using client certificate for authentication, which you first have to upload via the management portal.