Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- My environment.
- Jboss Fuse 6.3-310
- Karaf version 2.4.0.redhat-630310
- JVM
- Java Virtual Machine Java HotSpot(TM) 64-Bit Server VM version 25.162-b12
- Version 1.8.0_162
- Vendor Oracle Corporation
- Operating system
- Name Linux version 2.6.32-696.20.1.el6.x86_64
- My mission is seemingly simple, at least it has that appearance. I simply need to upload CSV files to an AWS server. I am registered with account.
- First I need to obtain an access token and use that to upload the files. I have not coded anything yet, trying to understand the best approach, I so hope to use Camel-Rest-DSL. It is required to communicate with JSON. But, the authentication part has me stuck, I’m pretty sure it uses OAuth2 auth, RestFul web service and JSON, this should just be a client, I was looking at WSS4J for JAX-RS OAuth2 but I don’t know. I really appreciate you guys and gals out there that know, please suggest my best approach to accomplish this so I don’t go down too many paths. Thank you!!!
- I’ve done it with postman, this is the scenario. The username and password are fictional
- *Get Access Token
- uses POST verb
- requires Token Request URL
- uses Basic Auth requires Username = Client ID of tenant ( needs to be encoded base64 )
- HEADER parm Content-Type = x-www-form-urlencoded
- Content-Type': 'application/x-www-form-urlencoded',
- 'Authorization': 'Basic ' + encoded Client ID
- Access Token body - grant_type, username, password
- Body = username = 5c0642fe-a495-44db-93f7-67034556fa2c061_ingestor
- password = 154f0252d166f27b5e21ef171b03212a79f41a0daf3
- grant_type = password
- #returns the access_token as JSON
- POST or upload files
- uses POST verb
- requires Ingestion URL UploadURL
- UploadURL=https://apm-ts-query-svc-prd.app-api.aws-usw02-pr.something.io/v2/time_series/
- UploadFolder=upload
- headers =
- key Authentication "Bearer + access Token" (from request access token above)
- key Tenant = TenantUUID
- key X-GE-CsvFormat = ODB
- # Body
- form-data
- key file=file
- # POST DATA
- headers content-type application/json
- authorization: "" + token
- tenant: "" + tenant
Add Comment
Please, Sign In to add comment