Sharepoint web services(SOAP) (Java) how to add oauth2 access token

Copper Contributor

we are consumeing sharepoint web service using Basic and SAML authentication and it is working fine

but now we have to provide additional OAuth security for SharePoint web service, we successfully registered the application on the SharePoint site and we have received Access/Refresh Token now how to add this access token to SharePoint web service

for basic and SAML we are sending the token by setting cookie harder here is the sample code.

 

 ListsSoap mListsService = null;
                com.microsoft.schemas.sharepoint.soap.onlinelists.Lists listService = new 
                com.microsoft.schemas.sharepoint.soap.onlinelists.Lists(
                this._listsServiceURL, new QName(_Constants.SOAP_URL, "Lists"));
                mListsService = listService.getListsSoap();

               Map<String, List<String>> reqHeaders = new HashMap<String, List<String>>();
                List<String> list = new ArrayList<String>();
                list.add("some token");
                reqHeaders.put("Cookie", list);
                ((BindingProvider) mListsService).getRequestContext().put(MessageContext.HTTP_REQUEST_HEADERS, reqHeaders);
0 Replies