InteractionNotAllowed When Querying KeyChain

Hi,

I have looked high and low for an explanation of error code SecStatusCode.InteractionNotAllowed when querying a key from the KeyChain

var rec = new SecRecord (SecKind.GenericPassword){
        Generic = NSData.FromString (key)
};

SecStatusCode res;
var match = SecKeyChain.QueryAsRecord (rec, out res); 
if (res == SecStatusCode.Success) {

In this instance res equals SecStatusCode.InteractionNotAllowed

I have a log of this occurring in the application but can not replicate

Can someone please explain this status code and if possible suggest why this code would be propogated

Thanks in advance

Alex

Posts

  • Can anyone help with this please?

  • AlexComerford.2291AlexComerford.2291 USMember
    edited February 2015

    @RolfBjarneKvinge @BrendanZagaeski ... Do you have any advice? Thanks in advance

  • Bump !

  • VincentCheahVincentCheah MYMember

    Same here ... getting InteractionNotAllowed ... do you have any solution?

  • AlexComerford.2291AlexComerford.2291 USMember
    edited April 2015

    Hi Vincent,

    We switched our methodology in the end and moved away from KeyChain

    If you have business support I would drop them an email to see if they can help ... I got a response from them (which didn't help so much) but not on this forum (as you can see)

    The support staff who assisted was called John Miller ( @JohnMiller maybe?)

    Looking at John's email again it could have something to do with querying the KeyChain when the device is locked

    Good luck

    Alex

  • PaulFarrowPaulFarrow USMember

    We were experiencing exactly the same as described - InteractionNotAllowed. I basically played around abit and set the Accessible attribute to SecAccessible.AlwaysThisDeviceOnly on the save (SecKeyChain.Add(new SecRecord......)).

    I thought this would solve it but I was still getting interactionnotallowed. I then added the Accessible attribute with value SecAccessible.AlwaysThisDeviceOnly to the read of the keychain record I was querying. That did the trick I was able to access the keychain while my ios8 iphone6 was locked. So I think you need the Accessible attribute set on the save and the query. Hope that helps.

  • Appreciate the advice Paul!

    Will keep this in mind if we ever need to look at KeyChain again

    Thanks

    Alex

Sign In or Register to comment.