infor-cloud / m3-h5-sdk

https://infor-cloud.github.io/m3-h5-sdk/
36 stars 21 forks source link

[experimental-login] MIService in local development environment #55

Closed hldarshana closed 2 years ago

hldarshana commented 4 years ago

Hi,

Can we use new experimental-login feature to test MIService in local development environment? If so, is there any example (including how to set ionApiConfig and it's path) to refer?

Thank You

anhallbe commented 4 years ago

Yes! You can use the ~experimental-login~ login command since version ~3~ 4. More detailed docs are on their way.

This is a new ~(experimental)~ feature. So please try it out, and all feedback/issue reports are appreciated.

In short, the steps are:

  1. Configure and download an .ionapi file (see below)
  2. Run odin login ./path/to/downloaded-file.ionapi 2.1 Add the --update-config or -c flag to the above command to automatically update odin.json. So odin login -c .....
  3. Run odin serve --multi-tenant --ion-api

Now, requests to e.g /m3api-rest will be redirected to the configured ION API endpoint in the development proxy.

You can also configure it so that requests will be proxied directly to M3, without the ION API in between. This may be necessary if for instance the M3 API you are using is not accessible through ION API:

  1. See step 1 above. The ION API config is still needed for login.
  2. Run odin login --update-config --m3 https://url.to.m3 ./path/to/downloaded-file.ionapi
  3. Run odin serve --multi-tenant

See: odin-login

Configuring ION API

You should look into the ION API documentation for more detailed instructions on what to do (and what NOT to do). Make sure you are aware of the security implications of authorizing apps like this. But the following is one way to do it:

  1. Go to the InforOS portal, and open the ION API application: 1-open-ionapi
  2. Go to the "Authorized Apps" section and "Add new app": 2-authorized-apps
  3. Configure it something like this, and "Save" it: 3-config
  4. Download the .ionapi file: 4-download-credentials
swuendri commented 2 years ago

Are there any open points @hldarshana here? If not close the issue please.