Page tree
Skip to end of metadata
Go to start of metadata

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.

Sample Code Block
 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.

9 Comments

  1. Anonymous

    how do we get the initial user code?

    that "ricozt" in your example?

  2. 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.

  3. 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.

  4. 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!

  5. 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/

  6. 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.

  7. 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.

  8. 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.

  9. 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!

Write a comment…