Authentication methods, Java API


(Gzazo) #1

Hi,

I’m trying to implement a ttn application to register, remove applications and add, remove and modify devices inside applications. I’m a little bit confused about authentication methods:

Access Key
What exactly mean access key? when to use it? Ho can I get an access key? In the app-sdk there is an example ApplicationAccessKeySync/Async the only input parameter seems the application key, where i found it?

Bearer Token
For what I understand from docs and sdk I should need a barrier token, how can i get it? There are two ways: password flow and the authorization_code flow and I found two examples related ApplicationPasswordSync and AuthorizationCodeSync.
I suppose my way is trough password I don’t need to redirect anything, I already sent an email to get a client_id and a client_secret, but I have some questions about the code.

Form ApplicationPasswordSync.java
ApplicationPassword tokenProvider = new ApplicationPassword(_conf.applicationId, _conf.applicationKey, _conf.cliendId, _conf.clientSecret);
What is applicationKey? is the access key? and why you have to pass it as parameter? the token is related to only an app?
Ho can I get a list of apps? From the class Discovery there is no way.

Thanks


Where to get the client_secret?
(Gzazo) #2

Hi,

after a lot of emails with ttn support, I’m a little bit confused where to get the client_secret associated to my account/collaborator?
I don’t know why but the support guy stopped to answer me, maybe I miss something?

I need to manage the devices in batch mode, I’m using the java api and the only way to login it seems with client_id and client_secret

Can you help me?

Thanks