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

Plugin not working with 2FA authent #16

Closed
Damounet opened this issue Jul 18, 2022 · 2 comments
Closed

Plugin not working with 2FA authent #16

Damounet opened this issue Jul 18, 2022 · 2 comments

Comments

@Damounet
Copy link

Hey,

I gave a try to the plug in as my company uses service now extensivly and wanted to give it a go.
But when I run the plug in it fetch a 401, and I think it has to come from the authent used. My company uses Google Account with 2FA to authenticate to Service Now, I have put my credential data in the ini file but I don't get how the plug in can go through the 2FA by itself.

Is this a limitation ? Is it possible to give a token to the script ? I won't have the possibility to disable 2FA to test this out.

The log of the run:

2022-07-18 10:33:49 INFO   220:MyImporter           - =====================================
2022-07-18 10:33:49 INFO   221:MyImporter           - Starting ServiceNow import plugin ...
2022-07-18 10:33:49 INFO   222:MyImporter           - Getting properties from /Users/jpalon/Downloads/archimateSnow.ini
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property SNowPlugin.version = 1.7.2
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property http.proxyHost not found
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property http.proxyPort not found (defaulting to 0)
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property http.proxyUser not found
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property http.proxyPassword not found
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property servicenow.site = https://XXXXX.service-now.com
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property servicenow.user = XXXXXXX
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property servicenow.pass = @@@@@@@@@@
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property servicenow.sysparm_limit = 1000000
2022-07-18 10:33:49 INFO   297:MyImporter           - Getting elements from ServiceNow ...
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property archi.elements.*.id = sys_id
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property archi.elements.*.name = name
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property archi.elements.*.documentation = short_description
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property archi.elements.*.folder = sys_class_name
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property archi.elements.*.filter not found (defaulting to )
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property archi.elements.*.import_mode = create_or_update_only
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property archi.elements.*.property.company = company#name
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property archi.elements.*.property.date = ${date:dd/MM/yyyy HH:mm/ss}
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property archi.elements.*.property.oasis_created_by = sys_created_by
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property archi.elements.*.property.oasis_created_on = sys_created_on
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property archi.elements.*.property.oasis_updated_by = sys_updated_by
2022-07-18 10:33:49 DEBUG  108:MySortedProperties   -    property archi.elements.*.property.oasis_updated_on = sys_updated_on
2022-07-18 10:33:51 TRACE 1349:MyImporter           -       --> found field = cmdb_ci_aix_server
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property archi.elements.cmdb_ci_aix_server.snow_table = cmdb_ci_aix_server
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property archi.elements.cmdb_ci_aix_server.archi_class = "Node"
2022-07-18 10:33:51 INFO   352:MyImporter           - Found keyword "cmdb_ci_aix_server": mapping ServiceNow CIs from table cmdb_ci_aix_server to Archi "Node"
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property archi.elements.cmdb_ci_aix_server.id not found (defaulting to sys_id)
2022-07-18 10:33:51 TRACE 1349:MyImporter           -       --> found field = sys_id
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property archi.elements.cmdb_ci_aix_server.name not found (defaulting to name)
2022-07-18 10:33:51 TRACE 1349:MyImporter           -       --> found field = name
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property archi.elements.cmdb_ci_aix_server.documentation not found (defaulting to short_description)
2022-07-18 10:33:51 TRACE 1349:MyImporter           -       --> found field = short_description
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property archi.elements.cmdb_ci_aix_server.folder = "Serveurs"/"AIX"/os
2022-07-18 10:33:51 TRACE 1305:MyImporter           -       --> found constant = "Serveurs"
2022-07-18 10:33:51 TRACE 1305:MyImporter           -       --> found constant = "AIX"
2022-07-18 10:33:51 TRACE 1311:MyImporter           -       --> found field = os
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property archi.elements.cmdb_ci_aix_server.importMode not found (defaulting to create_or_update_only)
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property archi.elements.cmdb_ci_aix_server.property.processor = processor#display_name
2022-07-18 10:33:51 TRACE 1344:MyImporter           -       --> found field = processor (then field display_name in the reference link)
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property archi.elements.cmdb_ci_aix_server.property.pvus_per_core = processor#processor_mapping#pvus_per_core
2022-07-18 10:33:51 TRACE 1344:MyImporter           -       --> found field = processor (then field processor_mapping in the reference link)
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property company = company#name
2022-07-18 10:33:51 DEBUG  428:MyImporter           -    Found archi.elements.*.property.company = company#name
2022-07-18 10:33:51 TRACE 1344:MyImporter           -       --> found field = company (then field name in the reference link)
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property oasis_created_on = sys_created_on
2022-07-18 10:33:51 DEBUG  428:MyImporter           -    Found archi.elements.*.property.oasis_created_on = sys_created_on
2022-07-18 10:33:51 TRACE 1349:MyImporter           -       --> found field = sys_created_on
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property date = ${date:dd/MM/yyyy HH:mm/ss}
2022-07-18 10:33:51 DEBUG  428:MyImporter           -    Found archi.elements.*.property.date = ${date:dd/MM/yyyy HH:mm/ss}
2022-07-18 10:33:51 TRACE 1335:MyImporter           -       --> found variable = ${date:dd/MM/yyyy HH:mm/ss}
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property oasis_updated_by = sys_updated_by
2022-07-18 10:33:51 DEBUG  428:MyImporter           -    Found archi.elements.*.property.oasis_updated_by = sys_updated_by
2022-07-18 10:33:51 TRACE 1349:MyImporter           -       --> found field = sys_updated_by
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property oasis_updated_on = sys_updated_on
2022-07-18 10:33:51 DEBUG  428:MyImporter           -    Found archi.elements.*.property.oasis_updated_on = sys_updated_on
2022-07-18 10:33:51 TRACE 1349:MyImporter           -       --> found field = sys_updated_on
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property oasis_created_by = sys_created_by
2022-07-18 10:33:51 DEBUG  428:MyImporter           -    Found archi.elements.*.property.oasis_created_by = sys_created_by
2022-07-18 10:33:51 TRACE 1349:MyImporter           -       --> found field = sys_created_by
2022-07-18 10:33:51 DEBUG  108:MySortedProperties   -    property archi.elements.cmdb_ci_aix_server.filter not found (defaulting to )
2022-07-18 10:33:51 DEBUG  460:MyImporter           -    Generated URL is https://XXXXXX.service-now.com/api/now/table/cmdb_ci_aix_server?sysparm_limit=1000000&sysparm_fields=operational_status,sys_id,name,short_description,os,processor,processor,company,sys_created_on,sys_updated_by,sys_updated_on,sys_created_by&sysparm_exclude_reference_link=false&sysparm_query=operational_status=1
2022-07-18 10:33:51 FATAL   16:MyPopup              - Cannot get CIs from ServiceNow web service: 
org.archicontribs.servicenow.MyException: Error reported by ServiceNow website : code 401
        at org.archicontribs.servicenow.MyConnection.get(MyConnection.java:66)
        at org.archicontribs.servicenow.MyImporter.doImport(MyImporter.java:466)
        at com.archimatetool.editor.actions.ImportIntoModelAction.run(ImportIntoModelAction.java:37)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
        at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:414)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4565)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530)
        at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4351)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3927)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1154)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1045)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
        at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
        at com.archimatetool.editor.Application.start(Application.java:81)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
2022-07-18 10:33:51 FATAL   23:MyPopup              - MyException: Error reported by ServiceNow website : code 401
org.archicontribs.servicenow.MyException: Error reported by ServiceNow website : code 401
        at org.archicontribs.servicenow.MyConnection.get(MyConnection.java:66)
        at org.archicontribs.servicenow.MyImporter.doImport(MyImporter.java:466)
        at com.archimatetool.editor.actions.ImportIntoModelAction.run(ImportIntoModelAction.java:37)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
        at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:414)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4565)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530)
        at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4351)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3927)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1154)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1045)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
        at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
        at com.archimatetool.editor.Application.start(Application.java:81)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
2022-07-18 10:33:56 INFO   628:MyImporter           - 0 elements have been modified: 0 created, 0 updated, 0 removed.

Any help is appreciated.

@herve91
Copy link
Contributor

herve91 commented Jul 23, 2022

Hello,

Error 401 means "unauthorized" and I believe you get this error code because of the MFA your company has configured. Unfortunately, I do not access to any ServiceNow account with MFA to do any testing, so except if you can provide me with a test account (with no access to your company data, of course), I won't be able to implement MFA.

Best regards
Hervé

@Damounet
Copy link
Author

Hello,

I understand, and I don't think I will be able to provide you something like that.
I am looking over the API tokens to get the authorization working properly on my side.

Thanks for the answer !

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

2 participants