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

Problem using login command 4 for multitenant #165

Open
jtharing opened this issue Jan 27, 2023 · 3 comments
Open

Problem using login command 4 for multitenant #165

jtharing opened this issue Jan 27, 2023 · 3 comments

Comments

@jtharing
Copy link

Hi!

I am having problem establishing connection to our M3 Cloud multi-tenant to develop H5SDK apps. I am following the instructions on github (#55) but i am receiving an error when trying to retrieve the session cookie. The only parameter not explicitly stated is the url-to-m3 one, where i assumed. https://m3prdeuc1.m3.eu1.inforcloudsuite.com. Is this a correction assumption? I have followed the previous "installation"steps stated https://github.com/infor-cloud/m3-h5-sdk.

Any idea what i might be doing wrong?

Thanks!

This is the command i am running when i receive the error:

odin login -c --m3 https://m3prdeuc1.m3.eu1.inforcloudsuite.com Odin.ionapi

(the Odin.ionapi file is located in the same directory as the project itself)

-------------Command Promt messages----------------
C:\Users\thajoh0.DOMAIN\MeridionCETest>odin login -c --m3 https://m3prdeuc1.m3.eu1.inforcloudsuite.com Odin.ionapi
A browser will pop up where you will be asked to sign in and approve the authorization request.
Waiting for ION API Token
Got ION API token
Visiting 'https://m3prdeuc1.m3.eu1.inforcloudsuite.com/mne' to get session cookie
TypeError: _page._client.send is not a function
at getAllCookies (file:///C:/Users/thajoh0.DOMAIN/AppData/Roaming/npm/node_modules/@infor-up/m3-odin-cli/dist/commands/login.js:149:59)
at Timeout. (file:///C:/Users/thajoh0.DOMAIN/AppData/Roaming/npm/node_modules/@infor-up/m3-odin-cli/dist/commands/login.js:135:39)
at listOnTimeout (node:internal/timers:568:17)
at process.processTimers (node:internal/timers:511:7)
ERROR: Login command failed
Usage: odin [options] [command]

@swuendri
Copy link
Contributor

Hi @jtharing, you should use the ION API to access M3 and not M3 APIs directly. If I'm right this possibility was cancelled by Infor. Please use odin login -c Odin.ionapi to retrieve an access token. And you application should only call ION APIs.

@wesped0
Copy link

wesped0 commented Feb 13, 2023

Hi @jtharing, there is an issue when retrieving the cookies in the getAllCookies method due to a change in the puppeteer library.

In login.js, if you change the code from

const getAllCookiesResponse = await _page._client.send('Network.getAllCookies');

to

const cookies = await _page.cookies();
return cookies;

it will work.

@ismail-spoon
Copy link

I'm having similar problem which I mentionned in this issue.
#174

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants