public OauthToken validateToken(String token, String... scopes) throws OauthClientException { OauthToken oauthToken = validateToken(token); if (oauthToken==null) return null; if (oauthToken.validateScopes(scopes)) return oauthToken; else return null; }
public OauthToken validateToken(String token, String... scopes) throws OauthClientException { OauthToken oauthToken = validateToken(token); if (oauthToken==null) return null; if (oauthToken.validateScopes(scopes)) return oauthToken; else return null; }
/** * Validates token with the given scopes. Returns null if the given access token is invalid, otherwise OauthToken is returned. * * <p> * {@link BeesClient} must be constructed with OAuth client ID and client secret as the username and password. * * @param token non-null token * @param scopes array of scope that are expected to be granted for this token * @return null if the token is invalid such as expired or unknown to the CloudBees OAuth server or the expected * scopes are not found. */ public final @CheckForNull OauthToken validateToken(String token, String... scopes) throws OauthClientException { OauthToken oauthToken = validateToken(token); if (oauthToken==null) return null; if (oauthToken.validateScopes(scopes)) return oauthToken; else return null; }