Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Add microsoft.exchange.webservices.data.credential.BearerTokenCredentials #606

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kb000
Copy link

@kb000 kb000 commented May 2, 2017

This should address #579

@codecov-io
Copy link

codecov-io commented May 2, 2017

Codecov Report

Merging #606 into master will increase coverage by 0.04%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #606      +/-   ##
============================================
+ Coverage     10.43%   10.47%   +0.04%     
- Complexity        0      473     +473     
============================================
  Files           550      551       +1     
  Lines         20436    20451      +15     
  Branches       2626     2084     -542     
============================================
+ Hits           2132     2142      +10     
- Misses        18151    18154       +3     
- Partials        153      155       +2
Impacted Files Coverage Δ Complexity Δ
...rvices/data/credential/BearerTokenCredentials.java 66.66% <66.66%> (ø) 3 <3> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e1ba52...d6dd97b. Read the comment docs.

@dsebastien
Copy link

Hello,

Any chance to get this PR merged in the near future?
Am I mistaken if I think that without this, using the https://github.com/bookaroom/ews-java-api/blob/master/src/main/java/microsoft/exchange/webservices/data/credential/TokenCredentials.java is useless and doesn't work?

Currently I try to bind to an email item, but always end up with a 403 unauthorized error...

@kb000
Copy link
Author

kb000 commented Jul 20, 2017

From what I understand, TokenCredentials.java was designed to be used with a SAML or Kerberos tokens. The heavy lifting is done in WSSecurityBasedCredentials, the base class. I don't know much more about it than that it didn't work for me, living in the OAuth world of 2017.

I found success using AAD to get an OAUTH2 bearer token (e.g. from a POST to https://login.windows.net/common/oauth2/token?api-version=1.0). This PR allows the ews-java-api to pass that token along to the EWS SOAP service.

I was inspired by this StackOverflow answer, where someone was able to use EWS/SOAP directly with a bearer token: https://stackoverflow.com/questions/41875795/office-365-calendar-api-using-ews-and-oauth-2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants