I wrote some code that creates a map and allows users to click on the map. The click takes the lat,lng (of click) and queries a government's GIS database and returns the parcel number. They can also use the default search widget and search by address, which ultimately does the same thing.
I also added a polygon layer that outlines parcels and another polygon layer that outlines houses.
I am NOT USING AN API KEY. I am NOT using esriConfig.
The code works and seems fairly easy to disseminate. I just add:
Hi @ScottAndersonGQ - as for your question about "Do I need an API key?":
That depends on your account. If you are using an ArcGIS Developer account, then yes, you need an API key. If you are using an ArcGIS Online account, then no, API key is not required.
As shown on that page, if you're using an ArcGIS Online account, then "Basemap layers" and "Geocoding (not stored)" does not consume credits.
I also came across the same situation while configuring my application to use a token-based authentication from ArcGIS Enterprise.
If you check this codepen you can see what we mean.
There is no code to input an API key nor a token and yet the map loads without a problem.
All the basemaps from this documentation section works without authentication.
"For use without an API key
Use of these basemaps requires a valid ArcGIS Online organizational subscription or an ArcGIS Enterprise license."
Is it correct to assume these base maps don't need authentication of any kind to be loaded? If so, will it continue to be accessible in the future in the same manner?
Thanks for the reply, Bjorn
I understand API Keys are just for ArcGIS Online and Enterprise should use token or OAuth authentication, but what I don't understand is what tells ArcGIS that I really have a license in the first place if I can go to codepen or any other site and just input a code with no reference to my enterprise account whatsoever?
I'm asking all these questions because if we can just ship out a code without any API/token reference that's the way we will take it since we won't have to deal with another endpoint to handle authentication (we are using client_credentials tokens).
I just want to be certain that this approach will keep working in the future, in order to keep our site running without problems.
Just to give you a context, the website in question is only using the base map, all the other layers are being generated on the client side.
Technically there is nothing that tells ArcGIS that you indeed have an Enterprise license. It's a "paper" license. The terms are described in details in the E300 MLA - https://www.esri.com/en-us/legal/terms/product-specific-scope-of-use.
There's no special limits for using this keyless/tokenless approach - assuming you have the license.
We don't currently have any plans to change that as far as I know.