If connecting as a user, you will need to relevant user token, as well as the app key and app secret for the application from which the call is being made. The WWClient can be instantiated by calling the static method WWClient.buildClientApplicationAccess(userToken, appId, appSecret, authenticationEndpoint)
. The userToken is a string value passed back from full authentication via a browser. Once built, the WWClient can be authenticated. Once authenticated, all relevant Watson Work Services calls can be made.
public void getMe() throws WWException, UnsupportedEncodingException { // Note, the below values are not valid ones! WWClient client = WWClient.buildClientUserAccess("ricoZt", "5c0bf268-c363-4aae-bbec-e2dbebb2fb72", "vKTpM47ST8ME9gQ9iWt_VjknvMCW", new WWAuthenticationEndpoint(), "https://openntf.org"); client.authenticate(); assert("Paul Withers".equals(me.getDisplayName())); }
Authentication as a user returns a PeopleToken
which is passed to the authenticationResult
property of the WWClient
. This includes setting the expiry date for authentication. Subsequent calls using the same WWClient
object will check whether the expiry date has passed, in which case it will re-authenticate.
15 Comments
Anonymous
how do we get the initial user code?
that "ricozt" in your example?
Anonymous
This is very interesting, I like it. I will always come to visit after. I will recommend to friends too. Keep up the magnificent work. I think this is engaging and eye-opening material. rospher essays Thank you so much for caring about your content and your readers.
Anonymous
This became very easy to understand the static method and a lot of things to do like completing your projects, Custom dissertation help, and papers. Everything has to be managed through apps.
Anonymous
Thanks for the post and really it can be understood and Blade Runner Coat the content is good and I really appreciate the article. Appreciable!
Anonymous
This is very useful code for all students who learning programming. I definitely share this data with my students who are taking assignment writing service from me. Ida Wallace, assignment writing service provider at Assignment Help Folks. http://www.assignmenthelpfolks.com/finance/
Anonymous
I am thankful to you for providing here sample code block for WWClient object which will check whether the expiry date has passed, in which case it will re-authenticate. It will actually sharable information for IT learners whom I am also serving dissertation assistance at Dissertation Help - http://www.dissertationhelp.uk/ in UK. And hope it would be helpful for them.
Anonymous
Such wonderful blogs with almost all the current scenarios intact. We are the best Cleaning Company in Dubai, YallaCleaning fills in as the solid, trusted and disentangled cleaning center for the Middle East cleaning industry.
Anonymous
This article is well written and very informative. I really like this site because it offers loads of information to its followers. Furniture Rentals in Dubai bring for your luxury rental furniture. So contact us to get the best offer on furniture rentals also get detail of our furniture rental in Dubai to enjoy our rental furniture services.
Anonymous
i appreciated your hard work and content writer, Its very interesting and informative article for me. I would love to share your article to other platforms. Assassin's Creed Jacob Frye Costume Thanks for sharing!
Anonymous
This is so informative post. You shared here such a helpful information about Java with the code.
Regards,
Caroline Webb
http://www.assignmenthelpfolks.com/marketing/
Anonymous
Case Study Writing Service Provider are not that expensive for Custom Case Study Writing Services since they complete high standard Case Study Assignment Services?
Anonymous
Personally I am so happy to found this beautiful post. I think this information will helpful for all because you describe with the sample code.
Regards, Alyssa Patterson,
http://www.secureassignmenthelp.com/health-care-assignment-help/
Anonymous
It is understandable that one is more confident when their task is in the hands of the Professional Essay Writing Help than a novice; thus, one hires Essay Writing Assignment Help Writer who delivers the ideal Custom Essay Paper
Anonymous
Do you require Affordable Nursing Research Papers Services for your assignments’ needs, but you are unsure of the Legitimate Nursing Research Paper Writing firm to contract? Our Nursing Research Paper Writing Company has credibility and has been providing homework solutions.
Anonymous
I am happy to found this very informative blog about sample code block for WWClient. Thanks for sharing with us.
-Alex Juvion, http://www.qualityassignment.co.uk/marketing-coursework-help/
Add Comment