title: Django OAuth2 invalid grant_type
body: <p>I am using Django OAuth Toolkit and I successfully create sign_up call - which in return gives me this response:</p>
  
  <pre><code>{
    "username": "boban16",
    "client_id": "sxFB8WOd5qupdyp5c4pjJHXAQQFPVCW7FKA3SUmy",
    "client_secret": "3nUreBDpx9cCSEeVyOhpXZ76Om0keOxFwK2rRQJNK5wvYuA1tUF37sH0Of473wCgeJ3tCmflN9kPnP9VkgepWxrARC6iimqI6y34pyVU7otlcXHjS2SSOmsP2c0XNxrA"
  }
  </code></pre>
  
  <p>So, I am now trying to make a call to generate token using Postman application - request looks like this:
  <img src="https://i.stack.imgur.com/u9fMw.png" alt="Postman token generation call"></p>
  
  <p>And this is the response:</p>
  
  <pre><code>{
    "error_description": "Invalid credentials given.",
    "error": "invalid_grant"
  }
  </code></pre>
  
  <p>This is my code from <strong>urls.py</strong></p>
  
  <pre><code>urlpatterns = patterns('',
      url(r'^sign_up/$', SignUp.as_view(), name="sign_up"),
      url(r'^login/$', Login.as_view(), name="login"),
      url(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')),
  )
  </code></pre>
  
  <p>This is part from <strong>settings.py</strong></p>
  
  <pre><code>REST_FRAMEWORK = {
      'DEFAULT_AUTHENTICATION_CLASSES': (
          # 'rest_framework.authentication.BasicAuthentication',
          'oauth2_provider.ext.rest_framework.OAuth2Authentication',
      ),
      'DEFAULT_PERMISSION_CLASSES': (
          'rest_framework.permissions.AllowAny',
      ),
  }
  </code></pre>
  
  <p>I am not sure what is the problem and how can I fix it. Has anyone some advice how to make it work? Thanks a lot!</p>
  
  <p>------- UPDATE --------</p>
  
  <p>I finally got some response:</p>
  
  <pre><code>curl -v http://127.0.0.1:8000/o/token/ -X POST -u "&lt;client_id&gt;:&lt;client_secret&gt;" -d "grant_type=client_credentials"
  </code></pre>
  
  <p>And this is the response:</p>
  
  <pre><code>* Hostname was NOT found in DNS cache
  *   Trying 127.0.0.1...
  * Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
  * Server auth using Basic with user 'JNBUdgUJ44ndu49yeokHxU0ZUNfIbpdESC8PVTQU'
  &gt; POST /o/token/ HTTP/1.1
  &gt; Authorization: Basic Sk5CVWRnVUo0NG5kdTQ5eWVva0h4VTBaVU5mSWJwZEVTQzhQVlRRVTpaQVNwZ0xLY3didXA2ajJ2YlJqakc1WlFZenpWWFZWQU5HcHJ0WWZVNnIya2VpUkEzZW9vNlh5M0tSMENkOGpWN3FLT2xFTENoTHZTUk5vTzBkUE5YNGdoRXdvRnB4UDNKbHdxY0FqRkpIV0RmSkJzYnpmNjJ5dE5DaEFVM29RcA==
  &gt; User-Agent: curl/7.37.1
  &gt; Host: 127.0.0.1:8000
  &gt; Accept: */*
  &gt; Content-Length: 29
  &gt; Content-Type: application/x-www-form-urlencoded
  &gt; 
  * upload completely sent off: 29 out of 29 bytes
  * HTTP 1.0, assume close after body
  &lt; HTTP/1.0 401 UNAUTHORIZED
  &lt; Date: Sat, 13 Jun 2015 16:14:19 GMT
  &lt; Server: WSGIServer/0.2 CPython/3.4.3
  &lt; Content-Type: application/json
  &lt; Cache-Control: no-store
  &lt; Pragma: no-cache
  &lt; X-Frame-Options: SAMEORIGIN
  &lt; 
  * Closing connection 0
  {"error": "unauthorized_client"}
  </code></pre>
  
  <p>As you can see in response - I got authorization token, but it says at the end - unauthorized client. Is that okay or not? Thanks!</p>