An electronic device, comprising: an iris scanner for capturing iris samples of a user's iris; an ambient light sensor for measuring lighting condition in surroundings of the electronic device; a memory comprising computer program code for providing access control to at least a part of the electronic device to a user by using at least iris recognition of the user's iris and comprising a plurality of iris samples of the user's iris in a plurality of lighting conditions measured by the ambient light sensor; and a processor communicably coupled with the memory, the ambient light sensor and the iris scanner, the processor configured to execute the computer program code to cause the electronic device to: detect via the ambient light sensor, a particular lighting condition; detect whether the electronic device has the information associated with an iris sample in the particular lighting condition; and prompt the user to provide one or more iris samples of the user's iris to the iris scanner at the particular lighting conditions upon determining an iris sample in the particular lighting condition in the electronic device is missing information or prompt the user to provide alternate authentication upon detecting an unsuccessful iris recognition attempt by the user in the particular lighting condition for accessing at least a part of the electronic device by the user; wherein the processor is configured to detect the unsuccessful iris recognition attempt by: capturing at least one iris shot of the user's iris and matching the at least one captured iris shot with an existing iris template associated with the particular lighting condition, wherein unsuccessful iris recognition attempt is detected if a mismatch between the at least one iris shot and the existing iris template is greater than a pre-defined degree of mismatch. an iris scanner for capturing iris samples of a user's iris; an ambient light sensor for measuring lighting condition in surroundings of the electronic device; a memory comprising computer program code for providing access control to at least a part of the electronic device to a user by using at least iris recognition of the user's iris and comprising a plurality of iris samples of the user's iris in a plurality of lighting conditions measured by the ambient light sensor; and a processor communicably coupled with the memory, the ambient light sensor and the iris scanner, the processor configured to execute the computer program code to cause the electronic device to: detect via the ambient light sensor, a particular lighting condition; detect whether the electronic device has the information associated with an iris sample in the particular lighting condition; and prompt the user to provide one or more iris samples of the user's iris to the iris scanner at the particular lighting conditions upon determining an iris sample in the particular lighting condition in the electronic device is missing information or prompt the user to provide alternate authentication upon detecting an unsuccessful iris recognition attempt by the user in the particular lighting condition for accessing at least a part of the electronic device by the user; wherein the processor is configured to detect the unsuccessful iris recognition attempt by: capturing at least one iris shot of the user's iris and matching the at least one captured iris shot with an existing iris template associated with the particular lighting condition, wherein unsuccessful iris recognition attempt is detected if a mismatch between the at least one iris shot and the existing iris template is greater than a pre-defined degree of mismatch. detect via the ambient light sensor, a particular lighting condition; detect whether the electronic device has the information associated with an iris sample in the particular lighting condition; and prompt the user to provide one or more iris samples of the user's iris to the iris scanner at the particular lighting conditions upon determining an iris sample in the particular lighting condition in the electronic device is missing information or prompt the user to provide alternate authentication upon detecting an unsuccessful iris recognition attempt by the user in the particular lighting condition for accessing at least a part of the electronic device by the user; wherein the processor is configured to detect the unsuccessful iris recognition attempt by: capturing at least one iris shot of the user's iris and matching the at least one captured iris shot with an existing iris template associated with the particular lighting condition, wherein unsuccessful iris recognition attempt is detected if a mismatch between the at least one iris shot and the existing iris template is greater than a pre-defined degree of mismatch. capturing at least one iris shot of the user's iris and matching the at least one captured iris shot with an existing iris template associated with the particular lighting condition, wherein unsuccessful iris recognition attempt is detected if a mismatch between the at least one iris shot and the existing iris template is greater than a pre-defined degree of mismatch.