question

Peter avatar image
Peter asked

VRM Portal and Personal Access Tokens

Where on VRM Portal can we manage 'personal access tokens' for usage with external services?

VRM
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

7 Answers
Guy Stewart (Victron Community Manager) avatar image
Guy Stewart (Victron Community Manager) answered ·

Hi @bww,

VRM access token management (to the extent that it is offered) is described in the VRM API documentation - https://vrm-api-docs.victronenergy.com/#/

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Peter avatar image
Peter answered ·

So have I to write a program where user give me login, password to generate personal token? This is not more secure than just login by login and password.


Can I use personal token to login to mqtt?

3 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Hi @bww

The access token model is required when enabling 2FA for additional security.

So then you can have a unique token for each service, and not disclose your main password.

We are testing a VRM update to give more user control over access tokens, including the ability to add new ones from the UI, & revoke access to old ones.

I'll post an update here when it is released.

2 Likes 2 ·
Show more comments
Peter avatar image
Peter answered ·

Exceptionally good news. I'm waiting. When users can be able to generate token than I will immediately add tokens to GbbVictronWeb.gbbsoft.pl program.


But what about mqtt access using token?

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Peter avatar image
Peter answered ·

I generate token for myself (using beta version of VRM)

I put it to my program gbbvictronweb.gbbsoft.pl

Program put it to 'X-Authorization' as: Token <token>


And receive following error: Invalid access token received


I wanted to call: https://vrmapi.victronenergy.com/v2/installations/xxxxxx/stats?type=live_feed&interval=hours&start=1687125600&end=1687211999

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Did you replace the xxxxxx after the /installations with the actual site ID?
0 Likes 0 ·
Peter avatar image Peter Guy Stewart (Victron Community Manager) ♦♦ commented ·

Yes. Whole import is working. I changed only "Bearer" to "Token" on "X-Authorization".


OK. Now it is working. I put double space after "Token" word. After change to one space everything starts working... :-)

1 Like 1 ·
Peter avatar image
Peter answered ·

Now open issue is using token to login to MQTT on mqtt{index}.victronenergy.com

1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Peter avatar image Peter commented ·
Any information about add Token to login to Mqtt?
0 Likes 0 ·
Jim avatar image
Jim answered ·

For anyone having trouble with the authentication in VRM to authorize VictronConnect, The AppImage, at least as of 5.91 version of VictronConnect, has a need to have OpenSSL version 1.1 installed. New distributions use OpenSSL version 3, which has remove some of the functions. Under Fedora 38, this is easily fixed by `sudo dnf install openssl1.1`. Restart VictronConnect, and you should be in better shape. Hopefully the team with @mvader (Victron Energy) is able to make note of this or update the AppImage to work directly with newer Linux distributions.

The work done to bring VictronConnect to us Linux types is greatly appreciated.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Andre avatar image
Andre answered ·

EDIT:

Solved : the header X-Authorization has to content "Token" instead of "Bearer"



Hi,

I genrated successful an access token with

https://vrmapi.victronenergy.com/v2 /users/{idUser}/accesstokens/create

for longtime use.

bildschirmfoto-2024-05-21-um-120624.png


The question is how to login with this token

I tried to send a X-Authorization header using postman, but his fails.

bildschirmfoto-2024-05-21-um-122427.png



2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.