Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typo and poor description #1

Closed
utzl opened this issue Jun 28, 2021 · 3 comments
Closed

typo and poor description #1

utzl opened this issue Jun 28, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@utzl
Copy link

utzl commented Jun 28, 2021

thanks for the update.
In MMM-RNV.js there is a typo in line 35: "cliendID" instead of "cientID".

Unfortunately the application only shows "Loading" with my credentials from the RNV data hub and is not working.
I received these credentials:
@clientID=ba589733-8724-4f95-b4d0-b9f18a0*****
@TenantID=87cd3c4f-1e0a-4350-889e-3969cd4*****
@clientSecret=JzuJc-4Ed~BXl4w2I.B8JUu.b0GEn*****
@resource=1484212f-edce-452a-aae9-46141ba*****
@scope=https://rnv-dds-sandbox-graphqlextern.azurewebsites.net/user_impersonation
@hostname=https://graphql-sandbox-dds.rnv-online.de

--> oAuthURL == scope?
--> tenantID is not necessary?

please update the description for users without an api key. Thanks.

jupadin added a commit that referenced this issue Jun 29, 2021
@jupadin jupadin added the bug Something isn't working label Jun 29, 2021
jupadin added a commit that referenced this issue Jun 29, 2021
@jupadin
Copy link
Owner

jupadin commented Jun 29, 2021

Hi,
thanks for your issue.
I modified the code such that now it should be possible to generate an apiKey with the given credentials and use the module.

I also added more information in the readme regarding the given credentials.
The oAuthURL has to be the URL given by @scope and the tenantID is not necessary, right.

@utzl
Copy link
Author

utzl commented Jun 29, 2021

Hi, many thanks for the immediate fix.
Unfortunately the module is not running on my Pi.
Here is the log, hopefully you can find a reason:

[29.06.2021 21:22.11.139] [LOG] MMM-RNV: Fetching data from RNV-Server...
[29.06.2021 21:22.11.149] [LOG] MMM-RNV: Fetching data from RNV-Server...
[29.06.2021 21:22.11.162] [LOG] Error while querying data from server:
ApolloError: Network error: Unexpected token Y in JSON at position 0
at new ApolloError (/home/pi/MagicMirror/modules/MMM-RNV/node_modules/apollo-client/bundle.umd.js:92:26)
at /home/pi/MagicMirror/modules/MMM-RNV/node_modules/apollo-client/bundle.umd.js:1588:34
at /home/pi/MagicMirror/modules/MMM-RNV/node_modules/apollo-client/bundle.umd.js:2008:15
at Set.forEach ()
at /home/pi/MagicMirror/modules/MMM-RNV/node_modules/apollo-client/bundle.umd.js:2006:26
at Map.forEach ()
at QueryManager.broadcastQueries (/home/pi/MagicMirror/modules/MMM-RNV/node_modules/apollo-client/bundle.umd.js:2004:20)
at /home/pi/MagicMirror/modules/MMM-RNV/node_modules/apollo-client/bundle.umd.js:1483:29
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
graphQLErrors: [],
networkError: SyntaxError [ServerParseError]: Unexpected token Y in JSON at position 0
at JSON.parse ()
at /home/pi/MagicMirror/modules/MMM-RNV/node_modules/apollo-link-http-common/lib/index.js:35:25
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
name: 'ServerParseError',
response: Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: [Object],
[Symbol(Response internals)]: [Object]
},
statusCode: 401,
bodyText: 'You do not have permission to view this directory or page.'
},
message: 'Network error: Unexpected token Y in JSON at position 0',
extraInfo: undefined
}

@jupadin
Copy link
Owner

jupadin commented Jun 30, 2021

This might be the reason of an invalid access token / apiKey.
The generated key is only valid for a certain amount of time until it has to be refreshed.
Currently I'm working on this refresh method and try to implement as soon as possible.

@jupadin jupadin added enhancement New feature or request and removed bug Something isn't working labels Jun 30, 2021
jupadin added a commit that referenced this issue Jul 13, 2021
@jupadin jupadin self-assigned this Jul 13, 2021
jupadin added a commit that referenced this issue Jul 14, 2021
@jupadin jupadin closed this as completed Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants