Search in sources :

Example 1 with UserAccount

use of oauth2.service.UserAccount in project tesb-rt-se by Talend.

the class ThirdPartyAccessService method getUserCalendar.

@GET
public Calendar getUserCalendar() {
    OAuthContext oauth = getOAuthContext();
    String userName = oauth.getSubject().getLogin();
    UserAccount account = accounts.getAccount(userName);
    if (account == null) {
        account = accounts.getAccountWithAlias(userName);
    }
    return account.getCalendar();
}
Also used : OAuthContext(org.apache.cxf.rs.security.oauth2.common.OAuthContext) UserAccount(oauth2.service.UserAccount) GET(javax.ws.rs.GET)

Aggregations

GET (javax.ws.rs.GET)1 UserAccount (oauth2.service.UserAccount)1 OAuthContext (org.apache.cxf.rs.security.oauth2.common.OAuthContext)1