/** * Returns a new OAuth {@link Request} that can be used in * {@link DbxWebAuth#DbxWebAuth(DbxRequestConfig,DbxAppInfo)} to authorize a user. * * @return new OAuth {@link Request} configuration. * * @throws IllegalStateException if {@link #withState} was called with a non-{@code * null} value, but no redirect URI was specified. */ public Request build() { if (redirectUri == null && state != null) { throw new IllegalStateException("Cannot specify a state without a redirect URI."); } return new Request(redirectUri, state, requireRole, forceReapprove, disableSignup, sessionStore); } }