Class BaseOAuthAuthentication

    • Field Detail

      • LOGGER

        @NotNull
        protected static final Logger LOGGER
      • DEFAULT_ALLOW_CREATING_NEW_USERS_BY_LOGIN

        public static final boolean DEFAULT_ALLOW_CREATING_NEW_USERS_BY_LOGIN
        See Also:
        Constant Field Values
      • myOAuthFlow

        @NotNull
        protected final OAuthFlow myOAuthFlow
      • myOAuthProvider

        @NotNull
        protected final OAuthProvider myOAuthProvider
      • myDefaultScope

        @Nullable
        protected final String myDefaultScope
      • myAccessTokenControllerPath

        @NotNull
        protected final String myAccessTokenControllerPath
    • Method Detail

      • getUserRedirect

        @NotNull
        public String getUserRedirect​(javax.servlet.http.HttpServletRequest request)
      • processAuthenticationRequest

        @NotNull
        public HttpAuthenticationResult processAuthenticationRequest​(@NotNull
                                                                     javax.servlet.http.HttpServletRequest request,
                                                                     @NotNull
                                                                     javax.servlet.http.HttpServletResponse response,
                                                                     @NotNull
                                                                     Map<String,​String> properties)
                                                              throws IOException
        Description copied from interface: HttpAuthenticationScheme
        Processes authentication request.
        If the request does not correspond to this scheme, method must return HttpAuthenticationResult.notApplicable().
        If response object is changed inside the method, method must return HttpAuthenticationResult.unauthenticated().
        Specified by:
        processAuthenticationRequest in interface HttpAuthenticationScheme
        Parameters:
        request - request
        response - response
        properties - properties from config file
        Returns:
        result of processing, see above
        Throws:
        IOException - if some I/O error occurred
      • isMatchingUniqueRedirectPath

        protected boolean isMatchingUniqueRedirectPath​(@NotNull
                                                       String requestUrl)
      • isValidRedirectUrl

        protected boolean isValidRedirectUrl​(@NotNull
                                             String requestUrl,
                                             @Nullable
                                             String connectionId)
      • shouldSkip2FA

        public boolean shouldSkip2FA​(@NotNull
                                     javax.servlet.http.HttpServletRequest request,
                                     @NotNull
                                     Map<String,​String> properties)
        Description copied from interface: HttpAuthenticationScheme
        Returns whether two-factor authentication should be skipped when this scheme is used.
        Specified by:
        shouldSkip2FA in interface HttpAuthenticationScheme
        Parameters:
        request - request
        properties - properties from config file
        Returns:
        true if two-factor authentication should be skipped, false otherwise
      • prepareBackRedirectErrorMessage

        @NotNull
        protected String prepareBackRedirectErrorMessage​(@NotNull
                                                         String error,
                                                         @Nullable
                                                         String errorDescr)
      • getName

        @NotNull
        public String getName()
        Specified by:
        getName in interface AuthModuleType
        Returns:
        unique identificator (case-insensitive)
      • getDisplayName

        @NotNull
        public String getDisplayName()
        Description copied from interface: AuthModuleType
        Returns name of the authentication module to show in the UI
        Specified by:
        getDisplayName in interface AuthModuleType
        Returns:
        name of the authentication module to show in the UI
      • getDescription

        @NotNull
        public String getDescription()
        Description copied from interface: AuthModuleType
        Returns description of the authentication module to show in the UI
        Specified by:
        getDescription in interface AuthModuleType
        Returns:
        description of the authentication module to show in the UI
      • isMultipleInstancesAllowed

        public boolean isMultipleInstancesAllowed()
        Specified by:
        isMultipleInstancesAllowed in interface AuthModuleType
        Returns:
        true, if multiple instances of this authentication module are allowed, false otherwise
      • describeProperties

        @NotNull
        public String describeProperties​(@NotNull
                                         Map<String,​String> properties)
        Description copied from interface: AuthModuleType
        Returns description of the specified properties map to be shown in UI
        Specified by:
        describeProperties in interface AuthModuleType
        Parameters:
        properties - properties
        Returns:
        description of the specified properties map
      • validate

        @Nullable
        public Collection<String> validate​(@NotNull
                                           Map<String,​String> properties)
        Description copied from interface: AuthModuleType
        Validates the current login module settings and returns the set of errors if found. Should return null if no errors found.
        Specified by:
        validate in interface AuthModuleType
        Parameters:
        properties - properties
        Returns:
        the collection of errors.
      • getRestrictingOptions

        @Nullable
        public String getRestrictingOptions​(@NotNull
                                            Map<String,​String> properties)
      • getEditPropertiesJspFilePath

        @Nullable
        public String getEditPropertiesJspFilePath()
        Specified by:
        getEditPropertiesJspFilePath in interface AuthModuleType
        Returns:
        path to JSP file to edit properties of this authentication module or null if authentication module has no properties
      • getConnectAccountController

        @NotNull
        public BaseController getConnectAccountController()
      • getLoginController

        @NotNull
        public BaseController getLoginController()
      • setUniqueRedirectService

        @Autowired(required=false)
        public void setUniqueRedirectService​(@NotNull
                                             UniqueRedirectService uniqueRedirectService)