Question: Been fighting this one all morning. Here are the links I have been pointed to and I am still having no luck:

<http://www.asp.net/visual-studio/overview/2013/release-notes-(release-candidate)>

<https://stackoverflow.com/a/18426574/1118218> (I did everything the accepted answer suggests)

<https://stackoverflow.com/a/18419011/1118218> (same question as above, but the solution here did not work either, does not resolve the classes)

I installed the ASPNET web tools refresh. Restarted visual studio. Everything seems to build correctly except for the AccountController. It cannot find AuthenticationIdentityManager(and IdentityStore). 

```
[Authorize]
public class AccountController : Controller
{
    public AccountController()
    {
        IdentityManager = new AuthenticationIdentityManager(new IdentityStore());
    }

    public AccountController(AuthenticationIdentityManager manager)
    {
        IdentityManager = manager;
    }

    public AuthenticationIdentityManager IdentityManager { get; private set; }
}

```

Any idea how to get this to work? All the nuget packages related to ASP.NET Identity, Owin, EF, and MVC are updated to the latest pre-release version.

Answer: 
Building on Matthew's answer, with Doorkeeper, I ended up using the following:

```
module TokenMacros
  def generate_access_token_for(user = nil)
    user ||= FactoryGirl.create(:user)
    authentication = FactoryGirl.create(:authentication, user: user)
    application = Doorkeeper::Application.create!(:name => "MyApp", :redirect_uri => "http://app.com")
    access_token = Doorkeeper::AccessToken.create!(:application_id => application.id, :resource_owner_id => authentication.identity.id)
    access_token.token
  end
end

```

which then allows me to call...

```
let(:user) { FactoryGirl.create(:user) }
let(:token) { generate_access_token_for(user) }

```

splendid
The easiest thing to do to avoid the duplication would be to define the token in the highest level describe so that it's available for all the examples in your spec.

In addition, to avoid any performance issue for the examples that don't depend on it, you can use `let` rather than `before` to define the token since `let` is lazily evaluated.

What you'd have then, is the following:

```
let(:access_token) do
  user = FactoryGirl.create(:user)
  authentication = FactoryGirl.create(:authentication, user: user)
  application = Doorkeeper::Application.create!(:name => "MyApp", :redirect_uri => "http://app.com")
  Doorkeeper::AccessToken.create!(:application_id => application.id, :resource_owner_id => authentication.identity.id)
  end

```

You'd need to also change your references to this token from `@access_token` to `access_token`, since you're defining a method and not an instance variable.