Hello Everyone,
Recently, I had a chance to work with windows Azure and SharePoint integration with SAP PI 7.4. In this blog, I will be sharing the use of Advantco REST adapter workbench and how to check AAD/SPO connection from the same.
1. PREPARATION STEPS:
STEP 1: Login to REST Workbench. For example, we have different URLs to access the REST WB in different environments.
DEV | https://vhxxxxxx.rot.hec.sap.biz:50001/webdynpro/dispatcher/advantco.com/rest~workbench/RESTAdapterWorkbench# |
QUAL | https://vhxxxxxx.rot.hec.sap.biz:50001/webdynpro/dispatcher/advantco.com/rest~workbench/RESTAdapterWorkbench# |
PROD | https://vhxxxxxx.rot.hec.sap.biz:44300/webdynpro/dispatcher/advantco.com/rest~workbench/RESTAdapterWorkbench# |
STEP 2: Load the required channel from the options and by clicking “Load from channel configuration”. (Refer below)
Best Practice-Table 1: AAD/SPO Connection details: (Prepare this table for your ease. It will be a single point of reference for all your scenario configurations in various environments)
Eg:
Details | DEV (mysapdev) | TEST (mysaptest) | PREPROD (mysappreprod) |
SPO URL | |||
Service account | |||
Password | 23qc!vA671 | Qom4o80053 | @4R@W96qgd |
Client ID | F122d7dc-b0ca-4a85-8dd9-15bff1662d11 | C456d2ee-c83f-4b03-af4d-a102c9583c84 | 30712d54-a206-48a9-a96e-070052409346 |
Key | pnAM6aEjaOk+hcJlHSuDiqZjl4QcHVvvuk5443os+pPQI= | rORN4T6hX5ksmMnIvaqxQ/2Q+xs/IqP2XRFiI9q87AdXs= | Tpf3gHD7+a8aTOVtwKVfqj1Lba7FAAmRr3FDzvc0vTD8s= |
Token Endpoint | https://login.windows.net/aedd7e88-7532-464b-845a-d2ac5f571dac/ oauth2/token?client_id=f122d7dc-b0ca-4a85-8dd9-15bff1662d11&client_secret=xxxxxxxxxx%2BhcJlHSuDiqZjl | https://login.windows.net/ca65293a-ed1d-48a8-b5ec-820f485de621/ oauth2/token?client_id=c456d2ee-c83f-4b03-af4d-a102c9583c84&client_secret=xxxxxxxxmMnIvaqxQ%2F2Q%2B | https://login.windows.net/cd866524-98aa-4ddc-a1a6-993aa95c19d5 /oauth2/token?client_id=30712d54-a206-48a9-a96e-070052409346&client_secret=xxxxxxx%2Ba8aTOVtwK |
This detail is configured in the “Authentication /Authorization” tab in the REST workbench.
Note:
The Client secret can either encoded or decoded using the online tool, http://www.urldecoder.org/
2. Testing AAD connection:
Sample AAD Operation: Eg Update Azure User details
Below is an example of updating the Azure user information from REST Workbench.
Azure Screenshot:
This confirms that we could connect to Azure system from REST WB.
Azure related information can be seen under the site, https://msdn.microsoft.com/en-us/library/azure/
3. Testing SPO Connection:
We have to get the Request Digest Token in order to do any SPO operation. This involves three steps;
STEP 1: Get Authorization Token
Eg: The token would be looking like below value;
t=EwAoA06hBwAUbl/sgipYGM8TysUFtClJteGnuzoAAY3+JHj81irl//GZbdH5oWSmnrR5EXZTrjkYiHrdMX0fUn4VBv0fbuNfzlx4lLGV90nnlDYbT cEpBxSXpW2tRqQQmxWPU0e6aynQyqYaNNAQN3R9RHTol1OZkLTbdouV8b/IhC58PHdyE2He4jeGDWVEWt5rWJmYX2P/VT56dJWqwpZgt kZ3NCKc/66h3YbP98aJ4B3UY4Hqst5gHqhGC37ovUgVMRnrTOldqDCHHaMr9OqB7V9X0B4ZRVogdXvQiZb6Afpx66bku4Iig0UwtDtVfbDcGlfq S+BbN72AMQLY5mdM7oG8ERA59GoIl6NDOKtt2dROQI2kwRAEUZihEgUDZgAACBV/+hZAeqGQ+AH36zbAOkcAbUbGfUOExWkzDZOwYa Wv5UdvFITgKELe+RFszeXf0Mzna003KWX/QVEh8Xl1O+F/Y/AGctR4x73zNLwDzrhYEuDASP/3z2oPqQmhHfilhDIFxxilEjhiB99CKIZ/SOqsLsb NSrWbquFo4dVNrOuyMDs/VH95X0qyv36Bey2b2XiOvU0FURvNkwSpm1+IMhtoIKH48DwABIBJHOIY0WeSfEVHq0O7OmIJ2+kv35KuWKyh6 QwTZMKEc4a3716cHaxeUm7k+pRLY4n5LYSBFWo4fDi0czVbGcoHzjQ4CK0+V9jFBZVvg0S8XBUCX8sq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5dGRhTl R1NnhsT3ZML2pIMWkvQT09LGh0dHBzOi8vbWNsYXJlbnNhcHRlc3Quc2hhcmVwb2ludC5jb20vc2l0ZXMvc3VwcGxpZXJzL192dGlfYmluL2lkY3JsLnN2Yy 88L1NQPg==; path=/; secure; HttpOnly |
STEP 3: Get Digest Token
<?xml version="1.0" encoding="utf-8"?><d:GetContextWebInformation xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:type="SP.ContextWebInformation"><d:FormDigestTimeoutSeconds m:type="Edm.Int32">1799</d:FormDigestTimeoutSeconds><d:FormDigestValue>0x8EFFC4D6F2205483163EA201308EB0C8BB9223C78907DBDAF32FEA59DF48F78B2102180B179795A1AF3CC2402CAB5D7E30C3C81A9A4963BDA19199FB191F55BD,16 Oct 2015 10:51:33 -0000</d:FormDigestValue><d:LibraryVersion>16.0.4524.1214</d:LibraryVersion><d:SiteFullUrl>https://mysaptest.sharepoint.com/sites/XYZ</d:SiteFullUrl><d:SupportedSchemaVersions m:type="Collection(Edm.String)"><d:element>14.0.0.0</d:element><d:element>15.0.0.0</d:element></d:SupportedSchemaVersions><d:WebFullUrl>https://mysaptest.sharepoint.com/sites/XYZ</d:WebFullUrl></d:GetContextWebInformation> |
So, now we have the Digest Token to do any operation in SharePoint site.
SAMPLE SPO OPERATION: Create SPO Site:
This confirms that we could connect to SharePoint Online system from REST Workbench.
Happy learning J
Regards,
Stenish Peter. S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |