Love this chapter, but still more questions


#1

First: Love this book and especially this design pattern. MVC alone always seemed like it was too hard to properly abstract and may be why I never grasped the hang of it properly. Adding the store portion clarifies the roles a bit and seems to reduce bits of redundant code. I am curious where in this pattern to handle authentication challenges. If I choose to implement didRecieveAuthenticationChallenge or willSendRequestForAuthenticationChallenge as part of the BNRConnection it seems I need to be able to throw up a view controller to prompt the user to get credentials. It doesn’t seem like a model object should be doing this. The book suggests storing user credentials would typically be done inside a store, and I could probably implement a KeychainItemWrapper inside the store to keep the credentials, however if credentials are expired I still need to prompt the user and I’m wondering what a good way to do that might be to keep things sufficiently abstract.

Any help or suggestions are appreciated.


#2

As bwestmoreland I’m also facing the same design decision: How to handle authentication that requires user intervention (i.e. OAuth2) under MVCS?. All the solutions that I’ve come up with seem to have significant drawbacks when it comes to the abstraction of the fulfillment of the request.

Any thoughts would be appreciated.

Cheers,
Jorge Luis


#3

Hmm, I don’t know much about OAuth2. How do you authenticate with it? Do you make a connection with some authentication details and then it challenges you with something and then you have to return something else via that same connection? What is it that you have to return?


#4

Also, ping me on Twitter at @joeconwaybnr - I’ll make sure to read this one again.