0

I am trying to use Oauth using Tyrus Web Socket.

I tried using:

AuthConfig authConfig = AuthConfig.Builder.create(). disableBasicAuth(). build();
Credentials credentials = new Credentials("Authentication", "Bearer Key"); 
client.getProperties().put(ClientProperties.AUTH_CONFIG, authConfig); 
client.getProperties().put(ClientProperties.CREDENTIALS, credentials);

But this doesn't work. I get an hand shake error.

chiwangc
  • 3,566
  • 16
  • 26
  • 32
  • You need to be more specific. What happens when you use it? Are there compiler errors, runtime errors or just nothing returned? – Johnathon Sullinger Jun 09 '15 at 05:14
  • @JohnathonSullinger I get a handshake error. Is this the correct way to use OAuth? – Pushkar Gupta Jun 09 '15 at 05:21
  • I personally don't know the answer to anything related to Oauth. I am just providing advice to help make your question easier to answer for those that can actually help. Make sure and update your question with the information related to the error so others can assist you with this. – Johnathon Sullinger Jun 09 '15 at 05:37
  • Tyrus currently supports only standard HTTP Auth schemes (Basic, Digest); if you want OAuth, you'll need to plug-in custom implementation. See Tyrus user guide (chapter 8.14.3) https://tyrus.java.net/documentation/1.10/user-guide.html#d0e1658 for info how to plug in custom auth scheme support. – Pavel Bucek Jun 09 '15 at 12:05
  • @PavelBucek I am new to web socket programming and tyrus, if you could help me with an example. – Pushkar Gupta Jun 10 '15 at 03:27

0 Answers0