org.wso2.carbon.utils.AuthenticationObserver Java Examples

The following examples show how to use org.wso2.carbon.utils.AuthenticationObserver. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SAML2SSOAuthenticator.java    From carbon-identity with Apache License 2.0 6 votes vote down vote up
private void handleAuthenticationStarted(int tenantId) {
    BundleContext bundleContext = SAML2SSOAuthBEDataHolder.getInstance().getBundleContext();
    if (bundleContext != null) {
        ServiceTracker tracker =
                new ServiceTracker(bundleContext,
                        AuthenticationObserver.class.getName(), null);
        tracker.open();
        Object[] services = tracker.getServices();
        if (services != null) {
            for (Object service : services) {
                ((AuthenticationObserver) service).startedAuthentication(tenantId);
            }
        }
        tracker.close();
    }
}
 
Example #2
Source File: SAML2SSOAuthenticator.java    From carbon-identity with Apache License 2.0 6 votes vote down vote up
private void handleAuthenticationCompleted(int tenantId, boolean isSuccessful) {
    BundleContext bundleContext = SAML2SSOAuthBEDataHolder.getInstance().getBundleContext();
    if (bundleContext != null) {
        ServiceTracker tracker =
                new ServiceTracker(bundleContext,
                        AuthenticationObserver.class.getName(), null);
        tracker.open();
        Object[] services = tracker.getServices();
        if (services != null) {
            for (Object service : services) {
                ((AuthenticationObserver) service).completedAuthentication(
                        tenantId, isSuccessful);
            }
        }
        tracker.close();
    }
}
 
Example #3
Source File: MutualSSLAuthenticator.java    From carbon-identity with Apache License 2.0 6 votes vote down vote up
private void handleAuthenticationStarted(int tenantId) {
    BundleContext bundleContext = MutualSSLAuthenticatorServiceComponent.getBundleContext();
    if (bundleContext != null) {
        ServiceTracker tracker =
                new ServiceTracker(bundleContext,
                        AuthenticationObserver.class.getName(), null);
        tracker.open();
        Object[] services = tracker.getServices();
        if (services != null) {
            for (Object service : services) {
                ((AuthenticationObserver) service).startedAuthentication(tenantId);
            }
        }
        tracker.close();
    }
}
 
Example #4
Source File: MutualSSLAuthenticator.java    From carbon-identity with Apache License 2.0 6 votes vote down vote up
private void handleAuthenticationCompleted(int tenantId, boolean isSuccessful) {
    BundleContext bundleContext = MutualSSLAuthenticatorServiceComponent.getBundleContext();
    if (bundleContext != null) {
        ServiceTracker tracker =
                new ServiceTracker(bundleContext,
                        AuthenticationObserver.class.getName(), null);
        tracker.open();
        Object[] services = tracker.getServices();
        if (services != null) {
            for (Object service : services) {
                ((AuthenticationObserver) service).completedAuthentication(
                        tenantId, isSuccessful);
            }
        }
        tracker.close();
    }
}
 
Example #5
Source File: SignedJWTAuthenticator.java    From carbon-identity with Apache License 2.0 6 votes vote down vote up
private void handleAuthenticationStarted(int tenantId) {
    BundleContext bundleContext = SignedJWTAuthenticatorServiceComponent.getBundleContext();
    if (bundleContext != null) {
        ServiceTracker tracker =
                new ServiceTracker(bundleContext,
                        AuthenticationObserver.class.getName(), null);
        tracker.open();
        Object[] services = tracker.getServices();
        if (services != null) {
            for (Object service : services) {
                ((AuthenticationObserver) service).startedAuthentication(tenantId);
            }
        }
        tracker.close();
    }
}
 
Example #6
Source File: SignedJWTAuthenticator.java    From carbon-identity with Apache License 2.0 6 votes vote down vote up
private void handleAuthenticationCompleted(int tenantId, boolean isSuccessful) {
    BundleContext bundleContext = SignedJWTAuthenticatorServiceComponent.getBundleContext();
    if (bundleContext != null) {
        ServiceTracker tracker =
                new ServiceTracker(bundleContext,
                        AuthenticationObserver.class.getName(), null);
        tracker.open();
        Object[] services = tracker.getServices();
        if (services != null) {
            for (Object service : services) {
                ((AuthenticationObserver) service).completedAuthentication(
                        tenantId, isSuccessful);
            }
        }
        tracker.close();
    }
}
 
Example #7
Source File: OIDCAuthenticator.java    From carbon-apimgt with Apache License 2.0 6 votes vote down vote up
private void handleAuthenticationStarted(int tenantId) {
    BundleContext bundleContext = OIDCAuthBEDataHolder.getInstance().getBundleContext();
    if (bundleContext != null) {
        ServiceTracker tracker =
                new ServiceTracker(bundleContext,
                        AuthenticationObserver.class.getName(), null);
        tracker.open();
        Object[] services = tracker.getServices();
        if (services != null) {
            for (Object service : services) {
                ((AuthenticationObserver) service).startedAuthentication(tenantId);
            }
        }
        tracker.close();
    }
}
 
Example #8
Source File: OIDCAuthenticator.java    From carbon-apimgt with Apache License 2.0 6 votes vote down vote up
private void handleAuthenticationCompleted(int tenantId, boolean isSuccessful) {
    BundleContext bundleContext = OIDCAuthBEDataHolder.getInstance().getBundleContext();
    if (bundleContext != null) {
        ServiceTracker tracker =
                new ServiceTracker(bundleContext,
                        AuthenticationObserver.class.getName(), null);
        tracker.open();
        Object[] services = tracker.getServices();
        if (services != null) {
            for (Object service : services) {
                ((AuthenticationObserver) service).completedAuthentication(
                        tenantId, isSuccessful);
            }
        }
        tracker.close();
    }
}
 
Example #9
Source File: SignedJWTAuthenticator.java    From attic-stratos with Apache License 2.0 6 votes vote down vote up
private void handleAuthenticationStarted(int tenantId) {
    BundleContext bundleContext = SignedJWTAuthenticatorServiceComponent.getBundleContext();
    if (bundleContext != null) {
        ServiceTracker tracker =
                new ServiceTracker(bundleContext,
                        AuthenticationObserver.class.getName(), null);
        tracker.open();
        Object[] services = tracker.getServices();
        if (services != null) {
            for (Object service : services) {
                ((AuthenticationObserver) service).startedAuthentication(tenantId);
            }
        }
        tracker.close();
    }
}
 
Example #10
Source File: SignedJWTAuthenticator.java    From attic-stratos with Apache License 2.0 6 votes vote down vote up
private void handleAuthenticationCompleted(int tenantId, boolean isSuccessful) {
    BundleContext bundleContext = SignedJWTAuthenticatorServiceComponent.getBundleContext();
    if (bundleContext != null) {
        ServiceTracker tracker =
                new ServiceTracker(bundleContext,
                        AuthenticationObserver.class.getName(), null);
        tracker.open();
        Object[] services = tracker.getServices();
        if (services != null) {
            for (Object service : services) {
                ((AuthenticationObserver) service).completedAuthentication(
                        tenantId, isSuccessful);
            }
        }
        tracker.close();
    }
}