Authorizing and Installing an app


Hi there,
I'm using to authorizing the Microsoft.Owin Framework, I have the startups below

public void Configuration(IAppBuilder app)

        app.UseCookieAuthentication(new CookieAuthenticationOptions());
        new OpenIdConnectAuthenticationOptions
            ClientId = clientId,
            Authority = "",
            RedirectUri = "",
            PostLogoutRedirectUri = redirectUri,
            Scope = "contacts automation",
            ResponseType = "id_token token",
            TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters() {  ValidateIssuer = false },
            Notifications = new OpenIdConnectAuthenticationNotifications
                AuthenticationFailed = OnAuthenticationFailed


But when I try to connect using "GetOwinContext"

                new AuthenticationProperties { RedirectUri = "/" },

Always got the following exception

Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.

Please can you help on this?
Many thanks.


Hi @fjpampliega,

I'm not particularly familiar with the Microsoft Owin framework, but that error seems to indication that there was an issue parsing JSON; is it possible that you expect to get JSON somewhere but are actually receiving something else? For example, is it possible that you're passing a file path to a method that takes a JSON string?

The error doesn't appear to be specifically related to the HubSpot APIs, but here are some stack overflow topics that have similar errors: