Examples of OAuthAppDAO


Examples of org.wso2.carbon.identity.core.dao.OAuthAppDAO

    public OAuthConsumerAppDTO[] getAllOAuthApplicationData() throws Exception {
        String userName = getLoggedInUser();
        String tenatUser = null;
        String domain = null;
        OAuthAppDAO dao = null;
        OAuthAppDO[] apps = null;
        OAuthConsumerAppDTO[] dtos = new OAuthConsumerAppDTO[0];

        if (userName != null) {

            OAuthMetaDataDTO metadata = new OAuthMetaDataDTO();
            metadata.setAccessTokenUrl(IdentityUtil.getProperty(ACCESS_TOKEN));
            metadata.setAuthorizeUrl(IdentityUtil.getProperty(AUTHORIZE_TOKEN));
            metadata.setRequestTokenUrl(IdentityUtil.getProperty(REQUEST_TOKEN));

            tenatUser = UserCoreUtil.getTenantLessUsername(userName);
            domain = UserCoreUtil
                    .getTenantDomain(OAuthServiceComponent.getRealmService(), userName);
            dao = new OAuthAppDAO(IdentityTenantUtil.getRegistry(domain, userName));
            apps = dao.getAllOAuthAppByUser(tenatUser);
            if (apps != null && apps.length > 0) {
                dtos = new OAuthConsumerAppDTO[apps.length];
                OAuthConsumerAppDTO dto = null;
                OAuthAppDO app = null;
                for (int i = 0; i < apps.length; i++) {
View Full Code Here

Examples of org.wso2.carbon.identity.core.dao.OAuthAppDAO

    public OAuthConsumerAppDTO getOAuthApplicationData(String applicationName) throws Exception {

        String userName = getLoggedInUser();
        String tenatUser = null;
        String domain = null;
        OAuthAppDAO dao = null;
        OAuthAppDO app = null;
        OAuthConsumerAppDTO dto = new OAuthConsumerAppDTO();;

        if (userName != null) {
            OAuthMetaDataDTO metadata = new OAuthMetaDataDTO();
            metadata.setAccessTokenUrl(IdentityUtil.getProperty(ACCESS_TOKEN));
            metadata.setAuthorizeUrl(IdentityUtil.getProperty(AUTHORIZE_TOKEN));
            metadata.setRequestTokenUrl(IdentityUtil.getProperty(REQUEST_TOKEN));

            tenatUser = UserCoreUtil.getTenantLessUsername(userName);
            domain = UserCoreUtil
                    .getTenantDomain(OAuthServiceComponent.getRealmService(), userName);
            dao = new OAuthAppDAO(IdentityTenantUtil.getRegistry(domain, userName));
            app = dao.getOAuthApp(tenatUser, applicationName);
            if (app != null) {
                dto.setApplicationName(app.getApplicationName());
                dto.setCallbackUrl(app.getCallbackUrl());
                dto.setOauthConsumerKey(app.getOauthConsumerKey());
                dto.setOauthConsumerSecret(app.getOauthConsumerSecret());
View Full Code Here

Examples of org.wso2.carbon.identity.core.dao.OAuthAppDAO

    public void registerOAuthApplicationData(OAuthConsumerAppDTO application) throws Exception {

        String userName = getLoggedInUser();
        String tenatUser = null;
        String domain = null;
        OAuthAppDAO dao = null;
        OAuthAppDO app = null;

        if (userName != null) {
            tenatUser = UserCoreUtil.getTenantLessUsername(userName);
            domain = UserCoreUtil
                    .getTenantDomain(OAuthServiceComponent.getRealmService(), userName);
            dao = new OAuthAppDAO(IdentityTenantUtil.getRegistry(domain, userName));
            app = new OAuthAppDO();
            if (application != null) {
                app.setApplicationName(application.getApplicationName());
                app.setCallbackUrl(application.getCallbackUrl());
                app.setOauthConsumerKey(UUIDGenerator.getUUID());
                app.setOauthConsumerSecret(UUIDGenerator.getUUID());
                app.setUserName(tenatUser);
                dao.createOrUpdateOAuthApp(app);
            }
        }
    }
View Full Code Here

Examples of org.wso2.carbon.identity.core.dao.OAuthAppDAO

    public void removeOAuthApplicationData(String applicationName) throws Exception {
        String userName = getLoggedInUser();
        String tenatUser = null;
        String domain = null;
        OAuthAppDAO dao = null;

        if (userName != null) {
            tenatUser = UserCoreUtil.getTenantLessUsername(userName);
            domain = UserCoreUtil
                    .getTenantDomain(OAuthServiceComponent.getRealmService(), userName);
            dao = new OAuthAppDAO(IdentityTenantUtil.getRegistry(domain, userName));
            dao.deleteOAuthApp(tenatUser, applicationName);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.