cancel
Showing results for 
Search instead for 
Did you mean: 

Authorization Process using C#

Highlighted
Occasional Contributor

Authorization Process using C#

I've been reviewing many of the posts about how to the the CTCTWrapper and the Authorization Process via the RedirectURL in the app.config file.  It appears you have two options:

 

1. Hard Coding Authorization Token - Some of the posts discussed ways to hard code the Authorization Token, but I could not find a post with an example.  Can someone show me code that tells me what needs to be done to incorporate the token and bypass the RedirectURL page?

 

2. C# Code for  RedirectURL Page - Can you provide me C# code or a link to sample code used for a RedirectURL Page?

 

Thanks.

 

6 REPLIES 6
CTCT Employee

Re: Authorization Process using C#

Hi,

 

We're hoping to have some updates to the .net wrapper made late next week that will provide an example redirect uri page.  Have you taken a look at either the contact signup example or campaign example provided with the .net wrapper?  That should show how to authenticate.  

 

Best Regards,

Shannon W.

API Support Specialist

CTCT Employee

Re: Authorization Process using C#

Hi,

 

We're hoping to have some updates to the .net wrapper made late next week that will provide an example redirect uri page.  Have you taken a look at either the contact signup example or campaign example provided with the .net wrapper?  That should show how to authenticate.  

 

Best Regards,

Shannon W.

API Support Specialist

Occasional Contributor

Re: Authorization Process using C#

I have looked at the contact form and email campaign form.  I was able to set up the API Key plus username and password of constant contact in the app.config files.  I was uncertain about what to put for the RedirectURL.  After reading several posts, I realized what I needed was my own  RedirectURL page.  Is there one that we can point to on the constant contact website as an interm solution?  If you have other thoughts then that's fine.  Otherwise, I will wait till you have the sample page available.

CTCT Employee

Re: Authorization Process using C#

My apologies, I haven't had a lot of time to look at how the wrapper stores the access token, but it's clearly not very straightforward to pass the value in and use it.  The wrapper as it currently stands was meant to take the username, password, and api key, and generate an access token itself for each session.  This isn't what was intended by us, so the wrapper is being modified so that it doesn't store the username/password, but instead stores access token.

 

I'm not sure exactly what this will look like once finished, but there will most likely be a redirect url page example.  Sorry we don't currently have a redirect URI you can use.  Bear with us as the wrapper gets modified; we're hoping for the updates to be available soon.

 

Best Regards,

Shannon W.

API Support Specialist

Occasional Contributor

Re: Authorization Process using C#

Maybe I am looking the old post. WHat need to be mentioned for the RedirectUrl?

Honored Contributor

Re: Authorization Process using C#

Hello,

 

In this case it looks like the original poster was looking for information about how to create a page that would be used as the Redirect URL when implementing OAuth 2. If you are working on an integration that needs to be capable of connecting to multiple accounts, then you will need to implement one of the flows for OAuth 2. If you're looking to implement OAuth, I would suggest reading about OAuth here: http://developer.constantcontact.com/docs/authentication/authentication.html

 

If you're not going to be connecting multiple accounts, you can simply generate an Access Token for the desired Constant Contact account and store it in a configuration. You can generate Access Tokens with our API tester located at https://constantcontact.mashery.com/io-docs

 

Sincerely,

Elijah G.
API Support Engineer