Guest User

Untitled

a guest
Mar 14th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. My environment.
  2. Jboss Fuse 6.3-310
  3. Karaf version 2.4.0.redhat-630310
  4. JVM
  5. Java Virtual Machine Java HotSpot(TM) 64-Bit Server VM version 25.162-b12
  6. Version 1.8.0_162
  7. Vendor Oracle Corporation
  8. Operating system
  9. Name Linux version 2.6.32-696.20.1.el6.x86_64
  10.  
  11. 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.
  12. 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!!!
  13.  
  14. I’ve done it with postman, this is the scenario. The username and password are fictional
  15. *Get Access Token
  16. uses POST verb
  17. requires Token Request URL
  18. uses Basic Auth requires Username = Client ID of tenant ( needs to be encoded base64 )
  19. HEADER parm Content-Type = x-www-form-urlencoded
  20. Content-Type': 'application/x-www-form-urlencoded',
  21. 'Authorization': 'Basic ' + encoded Client ID
  22. Access Token body - grant_type, username, password
  23. Body = username = 5c0642fe-a495-44db-93f7-67034556fa2c061_ingestor
  24. password = 154f0252d166f27b5e21ef171b03212a79f41a0daf3
  25. grant_type = password
  26.  
  27. #returns the access_token as JSON
  28.  
  29. POST or upload files
  30. uses POST verb
  31. requires Ingestion URL UploadURL
  32.  
  33. UploadURL=https://apm-ts-query-svc-prd.app-api.aws-usw02-pr.something.io/v2/time_series/
  34. UploadFolder=upload
  35. headers =
  36. key Authentication "Bearer + access Token" (from request access token above)
  37. key Tenant = TenantUUID
  38. key X-GE-CsvFormat = ODB
  39.  
  40. # Body
  41. form-data
  42. key file=file
  43. # POST DATA
  44. headers content-type application/json
  45. authorization: "" + token
  46. tenant: "" + tenant
Add Comment
Please, Sign In to add comment