oAuth2 (v1) deprecation

oAuth2 (v1) deprecation

philipfrench
Collaborator Collaborator
1,032 Views
0 Replies
Message 1 of 1

oAuth2 (v1) deprecation

philipfrench
Collaborator
Collaborator

[ Edited to correct the title. oAuth2(v1) is being deprecated. The replacement is oAuth2(v2). ]

 

You will have seen the oAuth2 (v1) deprecation notification. If you developed existing integration, or are a developer, the migration guide from Autodesk is very clear and gives you exactly what you need.

 

But if you copied examples without really understanding them, then following might help...

  1. if you have any javascript in your tenants (eg using the F360M V3 API)
  2. existing Postman changes
  3. attached is a patch for and old utility called 'Utility Pack' that you may have acquired.

Javascript

Your implementation of the authentication required for V3 API might look like the example below.

You can see how the payload is simplified, the URL changed, and the Authorization header is added.

 

mig4.jpg

At line 16 on the right, you see a dependency to a 'Base64' function. Create a library script called "Base64 Utils" and paste the contents of the attached text file into it. Change your script to Import the new libary.

 

Examples in Postman:

Most middleware implementations start with a practice in Postman, so this is a easy way to illustrate the change needed.

mig1.jpg

 

mig2.jpg

The value in the Authorization is made from your clientId (eg aaa) and clientSecret (eg bbb).

Join the values with a colon, and no spaces: aaa:bbb. This combined string we now have to encode.

I used the base64_encode library as above, but at your own risk and if you trust pasting your clientId/secret into an online site, you can google for "Base64 encode online" and choose a site that does free request. Paste aaa:bbb and ask it to encode, and copy the resulting string, eg ccc  (including any trailing equals signs)

Now the value in the Authorization header is:

Basic<space>ccc

 

 

mig2.jpg

philipfrench_1-1694689045101.png

 

Utility Pack instructions

If you don't know what this utility is, then perfect. Do not ask for it because I do not own it.

This fixes v1.06. Check your ver.txt. If you have another version, then stop here.

Use the attached zip file at your own risk.

Download the file to the "lib" folder of your utility.

Do NOT unpack the zip.

Rename the .zip to .jar.

 

[Do not change the name of the file, it is named with "++" to make it appear first in the classpath.]

If you see one or both of these lines in the log output, then the fix is succesfully applied:

philipfrench_4-1694689559022.png

To back-out the change, just delete the file.

In the zip are two files: Tenant.java and Tenant.class. It is possible that your virus checker will be unhappy downloading a zip containing a class file. Contact me directly if you have any issues.

 

 

1,033 Views
0 Replies
Replies (0)