Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6615397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:27:24+00:00 2026-05-25T20:27:24+00:00

We are using C2DM and are writing the server app in C#. We obtain

  • 0

We are using C2DM and are writing the server app in C#.

We obtain the authorization key with a POST using the WebRequest component. This works and we get back an encoded authorization key. The problem comes when we add this key to the auth header of the request that is going to send the message.

WebRequest request = WebRequest.Create("url");
...
request.Headers.Add(HttpRequestHeader.Authorization, "GoogleLogin auth=" + AuthorizationKey);

Since the key has the LF character, we get an exception…

Unhandled Exception: System.ArgumentException: Specified value has invalid CRLF characters.
Parameter name: value

   at System.Net.WebHeaderCollection.CheckBadChars(String name, Boolean isHeaderValue)

   at System.Net.WebHeaderCollection.Add(String name, String value)

It would seem that CheckBadChars() is refusing the authorization key because it thinks there is a CRLF in the key, when in fact there is only a LF.

Does anyone have any ideas how we could get around this issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:27:24+00:00Added an answer on May 25, 2026 at 8:27 pm

    Maybe you’re just getting a linebreak at the end that you’re supposed to remove?

    Edit: I read the documentation (at http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Response) and it says you’re supposed to get back a response that looks like this:

    SID=DQAAAGgA...7Zg8CTN
    LSID=DQAAAGsA...lk8BBbG
    Auth=DQAAAGgA...dk3fA5N
    

    There’s your three linebreaks. So what you need to do is pick out the the line starting with Auth= and grab the authorization token from there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with a messaging application using c2dm.. I get registered my app
I'm using clojure-http to make the following POST: (clojure-http.resourcefully/post https://android.apis.google.com/c2dm/send {Authorization (str GoogleLogin auth=
i'm trying to use C2DM client with this tutorial:http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html I'm using this code for
I am using C2DM application,I got registered in Google & the app is running
Do you have concrete step to know if an app is using C2DM? According
I'am developing a sample push notification app in android using c2dm. Here is my
My app is using Google's C2DM (push notification) to notify users about new activity
Using restlet, I want to make a post to android's c2dm service. I have
I'm using C2DM in my application, and it works well, but sometimes, when I'm
I'm using C2DM to send notification for my android App and it is working

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.