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 <hanen...@gmail.com>
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 <
> cdwijayarat...@gmail.com> 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 <hanen...@gmail.com>
>> 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 <
>>> cdwijayarat...@gmail.com> 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 <hanen...@gmail.com>
>>>> 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 <
>>>>> cdwijayarat...@gmail.com> 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 <hanen...@gmail.com
>>>>>> > 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
>>>>>>> Dev@wso2.org
>>>>>>> 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
> Dev@wso2.org
> 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
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to