Unable to Authorize with own ajax code

oauth2/authorize is not a URL that will return JSON or JSONP data. It is a page that you will redirect users to accept your app authorization.

See https://github.com/justintv/Twitch-API/blob/master/authentication.md for details on implementing the various types of auth flows.