Package com.ocient.auth

# Class OpenIDAuthenticators.DeviceAuthorizationGrant<T extends Token>

java.lang.Object
com.ocient.auth.OpenIDAuthenticators.DeviceAuthorizationGrant<T>

Enclosing class:
  `OpenIDAuthenticators`

public static class OpenIDAuthenticators.DeviceAuthorizationGrant<T extends Token> extends Object
The Device Authorization Grant is an extension that enables devices with no browser or limited input capability to use OAuth.

## Constructor Summary

Constructors
Constructor
Description
`DeviceAuthorizationGrant(String verificationUriComplete, String verificationUri, String userCode, OpenIDAuthenticators.TokenPoller<T> getToken)`

## Method Summary

Modifier and Type
Method
Description
`T`
`getToken(long timeoutMillis)`
Polls the issuer's /token endpoint for the authorization response.
`String`
`getUserCode()`
`String`
`getVerificationURI()`
`String`
`getVerificationURIComplete()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DeviceAuthorizationGrant

public DeviceAuthorizationGrant(String verificationUriComplete, String verificationUri, String userCode, OpenIDAuthenticators.TokenPoller<T> getToken)

## Method Details

### getUserCode

public String getUserCode()

### getVerificationURI

public String getVerificationURI()

### getVerificationURIComplete

public String getVerificationURIComplete()

### getToken

public T getToken(long timeoutMillis) throws AuthException, KeyManagementException, IOException, NoSuchAlgorithmException, KeyStoreException, InterruptedException, TimeoutException
Polls the issuer's /token endpoint for the authorization response.

Parameters:
  `timeoutMillis` - the number of milliseconds before the request should time out
Returns:
  `Token`
Throws:
  `AuthException` - when any exception occurs
  `KeyManagementException`
  `IOException`
  `NoSuchAlgorithmException`
  `KeyStoreException`
  `InterruptedException`
  `TimeoutException`