Manoj Chaurasia Posted January 14, 2019 Posted January 14, 2019 I selected "Basic" authentication when using the Fast Connector Framework Wizard.The call in Postman to get the token had the following properties: Method = "POST" URL=https://jwt-auth/v1/token Header = (Key = Content-Type, Value = "application/json") Body = { "email":"XXXX", "password":"ZZZZ" } This call returns a JSON formatted object containing the token needed to make additional calls to the application. Please Help, i am stuck
Wes Couturier Posted January 18, 2019 Posted January 18, 2019 Hello Prashant, For a more through answer, I would suggest that you post this question on the development forum located here: https://success.scribesoft.com/s/topic/0TO320000005QV0GAM/developer If you need more hands-on help, I would suggest that you call our Sales team to beings talks about receiving consulting. Thank you.
Joe Dotson Posted January 22, 2019 Posted January 22, 2019 One option is to select OAuth Token instead of Basic and adding email and password to the additional connection properties.
Manoj Chaurasia Posted January 23, 2019 Author Posted January 23, 2019 Hi Joe, Glad to see your response. I tried and added additional properties email and password and removed the Access Token property. Now i am trying to test the connection using the email and password, the connection established and shown a success message. This was working fine as earlier. Now in my Rest Api when we are using email and password and hit a token url, i am getting a api token and in my next call when i am trying to fetch the record like users or tiles list i need to send this token in header like "Bearer" + token I tried with below code but i am getting Authorization error protected override Func ConnectionConfiguration() { string LoginUrl = " { token = "Bearer " + rA.token; return "Bearer " + rA.token; } )) .ConnectionInfoToBaseUrl(info => info.BaseUrl) .End(); return myToken; } protected override IList ConfigureQueries() { var tiles = this.Queries.EnumerateResponseAs("/api/v1/tiles", r => r).ToHeader("Authorization", this.token); var tasks = this.Queries.EnumerateResponseAs("/api/v1/tasks", r => r); var users = this.Queries.EnumerateResponseAs("/api/v1/users", r => r); return new List { tiles, tasks, users }; }
Manoj Chaurasia Posted January 24, 2019 Author Posted January 24, 2019 Are you able to use PostMan to successfully retrieve Tiles, Tasks or Users If so, I would capture a Fiddler trace while attempting to retrieve the records. After that, I would compare the successful request (from PostMan) to the one made using the Fast Connector Integration Framework. That should give you an idea to what changes should be made.
Manoj Chaurasia Posted January 24, 2019 Author Posted January 24, 2019 Hey Rafael, Yes, I am able to retrieve the records using Postman. In Postman first i use to retrieve the token by url https://dev.practicepipeline.com/api/jwt-auth/v1/token with username: KiwiTech and password:k1W1t3C# Then using that token in header Authorization: "Bearer " + token and url https://dev.practicepipeline.com/api/tiles with get method we can retrieve tiles. you can try at your end using postman and let me know if needed any help.
Manoj Chaurasia Posted January 28, 2019 Author Posted January 28, 2019 Hi, I am still waiting for response, Can we please expect reply soon from you guys, We are getting very slow response from support team. I am stuck at some point. Is there any other way to connect you guys with screen sharing Please reply
Manoj Chaurasia Posted January 29, 2019 Author Posted January 29, 2019 If you are able to compare the request generated using PostMan to the one generated using the Fast Connector Integration Framework. Are you able to find any differences The differences could give us a hint to how we should modify the way that we are putting together the request.
Manoj Chaurasia Posted January 30, 2019 Author Posted January 30, 2019 Hi Rafael, Actually we are unable to the request created by Fast Connector Framework. We are just getting message "HTTP response code was 401" with other details. Please see the image below for your reference. We are also attaching the postman request/response screenshots for your reference. What we are doing here. First we are generating the token using username and password and after that we are using that generated token in header of other request to get the tiles. Please the images below. I think it will be best if can do a screen share to resolve this issue. We are unable to debug the issue so it will be helpful you guys can guide us over the screen share.
Joe Dotson Posted January 31, 2019 Posted January 31, 2019 Hi Prashant, Sorry for the delay on this, but I would like to arrange for someone on our team to assist you in a web session. Can you provide a time that would work for you during the 9:00AM-5:00PM EST timeframe Thanks, Joe
Manoj Chaurasia Posted February 1, 2019 Author Posted February 1, 2019 We can get on a call at 9:00 AM EST. Please share the dial in details.
Joe Dotson Posted February 1, 2019 Posted February 1, 2019 Hi Prashant, We'll need a little more lead time to set up the call with the engineer. Are you available this afternoon at 3:00 PM EST or Monday at 10:00 AM EST
Manoj Chaurasia Posted February 2, 2019 Author Posted February 2, 2019 Let's schedule for 10:00 AM EST please. There's a time difference here so this thread will be a continuous back and forth until something is scheduled. Let's assume that Prashant & KiwiTech team will be available and ready at 10:00am EST.
Manoj Chaurasia Posted February 4, 2019 Author Posted February 4, 2019 We can get on a call at 10:00 AM EST. Please share the invite with dial in details.
Joe Dotson Posted February 4, 2019 Posted February 4, 2019 Dave & Prashant, I sent you an email invite to a zoom meeting 10:00 EST. Please let me know if you didn't receive it or if you can't make the meeting. Thanks, Joe
Joe Dotson Posted February 4, 2019 Posted February 4, 2019 This took a little digging, but turned out to ultimately be pretty easy. First, the short answer is to map the query like this: Snippet: vartiles=this.Queries.EnumerateResponseAs("/api/v1/tiles",r=>r); ...and not try to map the header. I simplified the Connection registration: Snippet: .FromResponseToContext("Authorization",rA=>"Bearer"+rA.token) That code takes the response and creates a header named "Authorization" with the value rA=>"Bearer"+rA.token that will be used on every call. The context here is just the standard headers that the http client is initialized with. That should get you the header that you want on the query call. But that will get you to your next problem. The Tile type has an array of Tasks -- the FCF predates hierarchical data, so that will not work, and having it in there will result in an infinite recursive call that will get you a out of memory error. To fix that, comment out properties that are arrays. It would also be a good idea to make all of the properties not object (to me it looked like either strings or bools). Additionally, I can offer a little bit more information. If you use the ToHeader("Authorization", this.token), it will use the value at initialization. So, for example, if I changed the token declaration to: Snippet: publicstringtoken = "initialized value"; The header will be set to "initialized value". If you ever want to play around with some difficult code, the framework that is designed for human consumption is built on some less straightforward building blocks, and you can map using those. I do not recommend it, but I was able to get the following to work: Snippet publicKeyValuePairAuthMap(IReadOnlyDictionaryd,HttpContextcontext) { returnnewKeyValuePair("Authorization",this.token); } varempty=Enumerable.Empty(); varconnectionFormNameTypes=empty; varcontextNameTypes=new[]{newKeyValuePair("auth",typeof(string))}; varinputNameTypes=empty; varsources=newStringToStringMappingSources(connectionFormNameTypes,contextNameTypes,inputNameTypes); Funcfmap=AuthMap; varmapping=newStringToStringMapping(sources,fmap); vartiles=this.Queries.EnumerateResponseAs("/api/v1/tiles",r=>r).WithHeaderMapping(mapping); This would also require the previous connection registration where the token is set as part of the FromResponseToContext(). Again, I do not recommend it as it would probably be easier to create a connector using the standard CDK, than to use this. If you are almost all the way there, it might help with something.
Manoj Chaurasia Posted February 5, 2019 Author Posted February 5, 2019 Hi Joe, We are reviewing the code and will let you know if facing any issue. Thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now