Actually, I did create a CustomUserStoreManager inheriting from ReadWriteLDAPUserStoreManager and overrode its method doAuthenticate, I packaged it as an OSGi bundle and put it under dropins, it's working fine. I was just looking for a conceptually more adequate solution but as I can see it's almost the same thing. I agree doPreAuthenticate makes more sense but it's going to take me the same effort to generate another working bundle. Although for the front part I need to change the creation form which corresponds to the component org.wso2.carbon.identity.user.profile.ui_5.6.34. For this I need to recompile the plugin and replace it. Please correct me if I'm wrong.
Regards, Hanen On Fri, Dec 23, 2016 at 1:50 PM, Chamila Wijayarathna < [email protected]> wrote: > Hi Hanen, > > If you only need the changes we discussed above about authentication and > no changes for any functionality in identity.mgt component, I think it > would be better to add your logic as a new component with a new > implementation of UserStoreEventListener rather than changing identity.mgt > component. [1] contains a sample component I wrote sometimes back, if you > need an idea about how to write a carbon component. If you only need > authentication functionality, your component only need to have pom, > serviceComponent class and listener implementation. After creating the > component, you can add the har file to repository/component/dropins folder > and OSGI will automatically pick it. > > Hope that helps! > Chamila > > [1]. https://github.com/wso2/product-is/tree/master/ > modules/samples/workflow/handler/service-provider > > On Fri, Dec 23, 2016 at 11:35 PM, Hanen Ben Rhouma <[email protected]> > wrote: > >> Thanks Chamila, >> >> I think I need then to override IdentityMgtEventListener which is within >> the jar org.wso2.carbon.identity.mgt_5.6.34. >> >> Do I have to use a patch ? If so, do I need to ckeck out the source code >> of org.wso2.carbon.identity.mgt_5.6.34, change it and deploy a new jar >> which I need to put within patches directory? >> >> >> >> Regards, >> Hanen >> >> On Fri, Dec 23, 2016 at 12:49 PM, Chamila Wijayarathna < >> [email protected]> wrote: >> >>> Hi Hanen, >>> >>> If you need to check only working hours and public holidays while >>> authentication, you can implement that by implementing a >>> UserStoreEventListener [1]. You can implement doPreAuthenticate method in >>> your listener implementation and check your time and holiday related logic >>> there, and fail authentication if login time is not withing a permitted >>> time period. You'll have to save your public holiday list in some >>> datasource accessible to this listener. >>> >>> However, I'm not sure how much effort you'll have to put, if you are >>> going to set the public holiday list at tenant creation time. >>> >>> [1]. https://docs.wso2.com/display/IS510/User+Store+Listeners >>> >>> On Fri, Dec 23, 2016 at 10:36 PM, Hanen Ben Rhouma <[email protected]> >>> wrote: >>> >>>> Thanks Chamila, >>>> >>>> Let's say it's custom and inherits from LDAPReadWriteUserStoreManager, >>>> what are the methods I need to override? >>>> >>>> Regards, >>>> Hanen >>>> >>>> On Fri, Dec 23, 2016 at 11:25 AM, Chamila Wijayarathna < >>>> [email protected]> wrote: >>>> >>>>> Hi Henen, >>>>> >>>>> As per my understanding, in this scenario, you'll have to implement a >>>>> custom user store manager to extend authentication facilitate your custom >>>>> need, In that case you should be able to save this list of holidays in a >>>>> datasource which is accessible by your custom user store manager. >>>>> >>>>> >>>>> On Fri, Dec 23, 2016 at 9:16 PM, Hanen Ben Rhouma <[email protected]> >>>>> wrote: >>>>> >>>>>> Yes it's per tenant but this attribute is taken into account for each >>>>>> user authentication request. >>>>>> >>>>>> >>>>>> >>>>>> Regards, >>>>>> Hanen >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Fri, Dec 23, 2016 at 10:53 AM, Chamila Wijayarathna < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> Hi Hanen, >>>>>>> >>>>>>> What is the purpose of getting list of publicHolidays in user >>>>>>> creation form? Public Holidays attribute is not per user thing, is it? >>>>>>> >>>>>>> >>>>>>> On Fri, Dec 23, 2016 at 8:48 PM, Hanen Ben Rhouma < >>>>>>> [email protected]> wrote: >>>>>>> >>>>>>>> Hello, >>>>>>>> >>>>>>>> Is it possible to store in an external LDAP an attribute >>>>>>>> representing publicHolidays which is a list of dates, the idea is to >>>>>>>> have a >>>>>>>> custom attribute within the user creation form which accepts comma >>>>>>>> separated dates through a date picker widget. >>>>>>>> >>>>>>>> Do you think it's feasible within WSO2 IS? >>>>>>>> >>>>>>>> >>>>>>>> Regards, >>>>>>>> Hanen >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> Dev mailing list >>>>>>>> [email protected] >>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Chamila Dilshan Wijayarathna, >>>>>>> PhD Research Student >>>>>>> The University of New South Wales (UNSW Canberra) >>>>>>> Australian Centre for Cyber Security >>>>>>> Australian Defence Force Academy >>>>>>> PO Box 7916, Canberra BA ACT 2610 >>>>>>> Australia >>>>>>> Mobile:(+61)416895795 <+61%20416%20895%20795> >>>>>>> >>>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Chamila Dilshan Wijayarathna, >>>>> PhD Research Student >>>>> The University of New South Wales (UNSW Canberra) >>>>> Australian Centre for Cyber Security >>>>> Australian Defence Force Academy >>>>> PO Box 7916, Canberra BA ACT 2610 >>>>> Australia >>>>> Mobile:(+61)416895795 <+61%20416%20895%20795> >>>>> >>>>> >>>> >>> >>> >>> -- >>> Chamila Dilshan Wijayarathna, >>> PhD Research Student >>> The University of New South Wales (UNSW Canberra) >>> Australian Centre for Cyber Security >>> Australian Defence Force Academy >>> PO Box 7916, Canberra BA ACT 2610 >>> Australia >>> Mobile:(+61)416895795 <+61%20416%20895%20795> >>> >>> >> >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Chamila Dilshan Wijayarathna, > PhD Research Student > The University of New South Wales (UNSW Canberra) > Australian Centre for Cyber Security > Australian Defence Force Academy > PO Box 7916, Canberra BA ACT 2610 > Australia > Mobile:(+61)416895795 <+61%20416%20895%20795> > >
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
