vmg
vmg

Reputation: 10566

Writing hipchat client: HipChat Authentication

I am prototyping HipChat client and I'm stuck at building good authentication experience. I would like to implement similar authentication dialog as HipChat clients built by Atlassian provide. There is no need to generate auth tokens/etc, you just type email/password and client is able to obtain oauth token.

How do they do? Clients use com.atlassian.hipchat.win-clients as client_name in request to https://www.hipchat.com/users/authorize.

Question that I have: how do I register my own client? If I use any random name I get "Named OAuthClient not found ".

How to register client name that will work with any HipChat server, including hipchat.com?

Upvotes: 2

Views: 859

Answers (2)

orange
orange

Reputation: 740

Updated:

I made an example. Please take a look.

https://github.com/chenghuang-mdsol/StandupCat

@VitaliyGanzha There's a way I used: Build an auth provider based on the integration token.

  1. Make an integration, take down the auth_token.
  2. Use this auth_token on the api here: https://www.hipchat.com/docs/apiv2/method/generate_token

use grant_type 'password', and fill username and password in your post request.

  1. It will return the user info.
  2. Based on the user info it returned, you do your membership provider.
  3. Note that this auth_token has very limited permission. If you want to do more than authentication, you need another personal auth_token which can be generated in your account center.

Tested in C# WCF

Upvotes: 3

vmg
vmg

Reputation: 10566

Here I've got an answer that it is not possible right now:

This is currently not possible. The flow you described with the com.atlassian.hipchat.win-clients oauth id is used internally inside our new desktop and mobile clients. The only other way to obtain an access token via a 3-legged oauth flow is to create an add-on that you have to require a HipChat customer to install. Our OAuth tokens are scoped by group. We don't have allow global tokens. Sorry about that.

https://answers.atlassian.com/questions/32989448/writing-hipchat-client-hipchat-authentication

Upvotes: 0

Related Questions