Authentication methods, Java API

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

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

Hey, do you still need help on this?

No thanks.

Anything to share for future readers then?

I’m an embedded software engineer and this is my experience when I did my custom console for our production purpose, I don’t know how the API are changed so read carefully.
The Node.js API is the fastest way to manage devices in batch mode, by my point of view. The app access is guaranteed by the simple use of ACCESS KEYS, instead the java API offers the classic OAuth service, that is much more hard to manage and requires additional services.

Thanks

1 Like