Class BasicClaimsSourceImpl

    • Constructor Detail

      • BasicClaimsSourceImpl

        public BasicClaimsSourceImpl​(OA2SE oa2SE)
      • BasicClaimsSourceImpl

        public BasicClaimsSourceImpl()
      • BasicClaimsSourceImpl

        public BasicClaimsSourceImpl​(org.qdl_lang.variables.QDLStem stem)
      • BasicClaimsSourceImpl

        public BasicClaimsSourceImpl​(org.qdl_lang.variables.QDLStem stem,
                                     OA2SE oa2SE)
    • Method Detail

      • getOmitList

        public List<String> getOmitList()
        This is the list of claims from the headers to omit. In other words, this module will reject these out of hand and never return them in a claims object. This is extremely useful in not having existing claims being over-written (which can happen if something like mod_auth_openidc is acting as an intermediary and adding spurious claims.)
        Returns:
      • setOmitList

        public void setOmitList​(List<String> omitList)
      • setConfiguration

        public void setConfiguration​(org.oa4mp.delegation.server.server.claims.ClaimSourceConfiguration configuration)
        Specified by:
        setConfiguration in interface org.oa4mp.delegation.server.server.claims.ClaimSource
      • getConfiguration

        public org.oa4mp.delegation.server.server.claims.ClaimSourceConfiguration getConfiguration()
        Specified by:
        getConfiguration in interface org.oa4mp.delegation.server.server.claims.ClaimSource
      • hasConfiguration

        public boolean hasConfiguration()
        Specified by:
        hasConfiguration in interface org.oa4mp.delegation.server.server.claims.ClaimSource
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface org.oa4mp.delegation.server.server.claims.ClaimSource
      • getOa2SE

        public OA2SE getOa2SE()
        Optionally, the service environment may be injected into a scope handler to get configuration of components, e.g.
        Returns:
      • setOa2SE

        public void setOa2SE​(OA2SE oa2SE)
      • getScopes

        public Collection<String> getScopes()
        Specified by:
        getScopes in interface org.oa4mp.delegation.server.server.claims.ClaimSource
      • process

        public net.sf.json.JSONObject process​(net.sf.json.JSONObject claims,
                                              org.oa4mp.delegation.server.ServiceTransaction transaction)
                                       throws org.oa4mp.delegation.server.server.UnsupportedScopeException
        At the most basic level, this just returns the UserInfo object passed to it. Override as you deem fit.
        Specified by:
        process in interface org.oa4mp.delegation.server.server.claims.ClaimSource
        Parameters:
        claims -
        transaction -
        Returns:
        Throws:
        org.oa4mp.delegation.server.server.UnsupportedScopeException
      • process

        public net.sf.json.JSONObject process​(net.sf.json.JSONObject claims,
                                              javax.servlet.http.HttpServletRequest request,
                                              org.oa4mp.delegation.server.ServiceTransaction transaction)
                                       throws org.oa4mp.delegation.server.server.UnsupportedScopeException
        This also just returns the UserInfo object passed in. This has some legacy code. If you are writing a custom claim source, you really only need to invoke realProcessing(JSONObject, HttpServletRequest, ServiceTransaction) at the right time.
        Specified by:
        process in interface org.oa4mp.delegation.server.server.claims.ClaimSource
        Parameters:
        claims -
        request -
        transaction -
        Returns:
        Throws:
        org.oa4mp.delegation.server.server.UnsupportedScopeException
      • setGroupHandler

        public void setGroupHandler​(GroupHandler groupHandler)
      • realProcessing

        protected net.sf.json.JSONObject realProcessing​(net.sf.json.JSONObject claims,
                                                        javax.servlet.http.HttpServletRequest request,
                                                        org.oa4mp.delegation.server.ServiceTransaction transaction)
                                                 throws org.oa4mp.delegation.server.server.UnsupportedScopeException
        This is the actual place to put your code that only processes the claim source. The process(JSONObject, HttpServletRequest, ServiceTransaction) calls wrap this and invoke the pre/post processor for you. Your code should take whatever metadata is for the user and add it to the claims object.
        Parameters:
        claims -
        request -
        transaction -
        Returns:
        Throws:
        org.oa4mp.delegation.server.server.UnsupportedScopeException
      • setScopes

        public void setScopes​(Collection<String> scopes)
        Specified by:
        setScopes in interface org.oa4mp.delegation.server.server.claims.ClaimSource
      • getClaims

        public Collection<String> getClaims()
        returns a (unique) collection of claims.
        Specified by:
        getClaims in interface org.oa4mp.delegation.server.server.claims.ClaimSource
        Returns:
      • isRunOnlyAtAuthorization

        public boolean isRunOnlyAtAuthorization()
        This should usually be false. It is true only for those sources that can ONLY run at authorization, such as HTTPHeaderClaimsSource, where the information is simply not available in later phases.
        Specified by:
        isRunOnlyAtAuthorization in interface org.oa4mp.delegation.server.server.claims.ClaimSource
        Returns:
      • fromQDL

        public void fromQDL​(org.qdl_lang.variables.QDLStem stem)
        Specified by:
        fromQDL in interface org.oa4mp.delegation.server.server.claims.ClaimSource
      • toQDL

        public org.qdl_lang.variables.QDLStem toQDL()
        Specified by:
        toQDL in interface org.oa4mp.delegation.server.server.claims.ClaimSource
      • addToStem

        protected void addToStem​(org.qdl_lang.variables.QDLStem stem,
                                 String key,
                                 Object value)