Java源码示例:io.swagger.client.auth.OAuth

示例1
/**
 * Helper method to set access token for the first OAuth2 authentication.
 *
 * @param accessToken Access token
 */
public void setAccessToken(String accessToken) {
    for (Authentication auth : authentications.values()) {
        if (auth instanceof OAuth) {
            ((OAuth) auth).setAccessToken(accessToken);
            return;
        }
    }
    throw new RuntimeException("No OAuth2 authentication configured!");
}
 
示例2
/**
 * Helper method to set access token for the first OAuth2 authentication.
 *
 * @param accessToken Access token
 */
public void setAccessToken(String accessToken) {
    for (Authentication auth : authentications.values()) {
        if (auth instanceof OAuth) {
            ((OAuth) auth).setAccessToken(accessToken);
            return;
        }
    }
    throw new RuntimeException("No OAuth2 authentication configured!");
}