Package org.apache.airavata.security

Examples of org.apache.airavata.security.AuthenticationException


    String getUserName(HttpServletRequest httpServletRequest) throws AuthenticationException {

        String basicHeader = httpServletRequest.getHeader(AUTHORISATION_HEADER_NAME);

        if (basicHeader == null) {
            throw new AuthenticationException("Authorization Required");
        }

        String[] userNamePasswordArray = basicHeader.split(" ");

        if (userNamePasswordArray == null || userNamePasswordArray.length != 2) {
            throw new AuthenticationException("Authorization Required");
        }

        String decodedString = decode(userNamePasswordArray[1]);

        String[] array = decodedString.split(":");

        if (array == null || array.length != 1) {
            throw new AuthenticationException("Authorization Required");
        }

        return array[0];

    }
View Full Code Here


        if (gatewayId == null) {
            try {
                gatewayId = ServerSettings.getDefaultGatewayId();
            } catch (ApplicationSettingsException e) {
                throw new AuthenticationException("Unable to retrieve default gateway", e);
            }
        }

        return gatewayId;
    }
View Full Code Here

    private String[] getUserNamePassword(HttpServletRequest httpServletRequest) throws AuthenticationException {

        String basicHeader = httpServletRequest.getHeader(ServletRequestHelper.AUTHORISATION_HEADER_NAME);

        if (basicHeader == null) {
            throw new AuthenticationException("Authorization Required");
        }

        String[] userNamePasswordArray = basicHeader.split(" ");

        if (userNamePasswordArray == null || userNamePasswordArray.length != 2) {
            throw new AuthenticationException("Authorization Required");
        }

        String decodedString = servletRequestHelper.decode(userNamePasswordArray[1]);

        String[] array = decodedString.split(":");

        if (array == null || array.length != 2) {
            throw new AuthenticationException("Authorization Required");
        }

        return array;

    }
View Full Code Here

    }

    @Override
    protected boolean doAuthentication(Object credentials) throws AuthenticationException {
        if (this.getUserStore() == null) {
            throw new AuthenticationException("Authenticator is not initialized. Error processing request.");
        }

        if (credentials == null)
            return false;

        HttpServletRequest httpServletRequest = (HttpServletRequest) credentials;

        String[] array = getUserNamePassword(httpServletRequest);

        String userName = array[0];
        String password = array[1];

        try {
            return this.getUserStore().authenticate(userName, password);

        } catch (UserStoreException e) {
            throw new AuthenticationException("Error querying database for session information.", e);
        }
    }
View Full Code Here

    String getUserName(HttpServletRequest httpServletRequest) throws AuthenticationException {

        String basicHeader = httpServletRequest.getHeader(AUTHORISATION_HEADER_NAME);

        if (basicHeader == null) {
            throw new AuthenticationException("Authorization Required");
        }

        String[] userNamePasswordArray = basicHeader.split(" ");

        if (userNamePasswordArray == null || userNamePasswordArray.length != 2) {
            throw new AuthenticationException("Authorization Required");
        }

        String decodedString = decode(userNamePasswordArray[1]);

        String[] array = decodedString.split(":");

        if (array == null || array.length != 1) {
            throw new AuthenticationException("Authorization Required");
        }

        return array[0];

    }
View Full Code Here

        if (gatewayId == null) {
            try {
                gatewayId = ServerSettings.getSystemUserGateway();
            } catch (ApplicationSettingsException e) {
                throw new AuthenticationException("Unable to retrieve default gateway", e);
            }
        }

        return gatewayId;
    }
View Full Code Here

    private String[] getUserNamePassword(HttpServletRequest httpServletRequest) throws AuthenticationException {

        String basicHeader = httpServletRequest.getHeader(ServletRequestHelper.AUTHORISATION_HEADER_NAME);

        if (basicHeader == null) {
            throw new AuthenticationException("Authorization Required");
        }

        String[] userNamePasswordArray = basicHeader.split(" ");

        if (userNamePasswordArray == null || userNamePasswordArray.length != 2) {
            throw new AuthenticationException("Authorization Required");
        }

        String decodedString = servletRequestHelper.decode(userNamePasswordArray[1]);

        String[] array = decodedString.split(":");

        if (array == null || array.length != 2) {
            throw new AuthenticationException("Authorization Required");
        }

        return array;

    }
View Full Code Here

    }

    @Override
    protected boolean doAuthentication(Object credentials) throws AuthenticationException {
        if (this.getUserStore() == null) {
            throw new AuthenticationException("Authenticator is not initialized. Error processing request.");
        }

        if (credentials == null)
            return false;

        HttpServletRequest httpServletRequest = (HttpServletRequest) credentials;

        String[] array = getUserNamePassword(httpServletRequest);

        String userName = array[0];
        String password = array[1];

        try {
            return this.getUserStore().authenticate(userName, password);

        } catch (UserStoreException e) {
            throw new AuthenticationException("Error querying database for session information.", e);
        }
    }
View Full Code Here

    String getUserName(HttpServletRequest httpServletRequest) throws AuthenticationException {

        String basicHeader = httpServletRequest.getHeader(AUTHORISATION_HEADER_NAME);

        if (basicHeader == null) {
            throw new AuthenticationException("Authorization Required");
        }

        String[] userNamePasswordArray = basicHeader.split(" ");

        if (userNamePasswordArray == null || userNamePasswordArray.length != 2) {
            throw new AuthenticationException("Authorization Required");
        }

        String decodedString = decode(userNamePasswordArray[1]);

        String[] array = decodedString.split(":");

        if (array == null || array.length != 1) {
            throw new AuthenticationException("Authorization Required");
        }

        return array[0];

    }
View Full Code Here

        if (gatewayId == null) {
            try {
                gatewayId = ServerSettings.getSystemUserGateway();
            } catch (ApplicationSettingsException e) {
                throw new AuthenticationException("Unable to retrieve default gateway", e);
            }
        }

        return gatewayId;
    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.security.AuthenticationException

Copyright © 2018 www.massapicom. 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.