Giter Site home page Giter Site logo

Comments (9)

MartinPankraz avatar MartinPankraz commented on May 22, 2024 1

Microsoft Graph is its own product covering M365 (not only O365).

I lean towards the config screen (2nd screenshot you shared). @vikasbansal2022 what do you prefer?

from abap-sdk-for-azure.

MartinPankraz avatar MartinPankraz commented on May 22, 2024

Hi @PaddyCube,

the samples for Azure Blob can be found here. See the sdk for O365 service class to see some details about the SharePoint integration v1.

Regarding Microsoft Teams and SharePoint online integration I would recommend Microsoft Graph. That can be found here too. Design your Graph query using the explorer on the public sandbox or signin to your environment for a quicker implementation.

@vikasbansal2022 any samples that could be shared from our end?

from abap-sdk-for-azure.

PaddyCube avatar PaddyCube commented on May 22, 2024

Basically I need to upload to SharePoint site collection hosted in O365. Can i use this SDK for doing this? We created a ClientID in Admin center, added this ID to an AAD group and granted permissions to this group in our SharePoint Site Collection.

I use this small program to collect all files of a given document library. I'm able to get an AAD token but it always returns 401 when it tries to fetch data from SharePoint. We checked permissions of Client ID a couple of times and they're sufficient.

However, I'm confused about ClientID and SharePoint, V1, V2, ACL and this stuff. So can we use this SDK together with O365 only when we use outdated ACL instead of AAD accounts?

Do we need to switch to Graph these days (whatever this is)?

REPORT z_o365_test.

DATA: o365_sharepoint TYPE REF TO zcl_o365_service_sharepoint.

TRY.
    DATA(o365) = NEW zcl_o365_service_factory( ).
    o365_sharepoinT ?= o365->create( iv_interface_id = 'AZURE_O365' ).

    o365_sharepoint->read_all_file_from_folder(
      EXPORTING
        iv_folder_name = 'Shared%20Documents'
          IMPORTING
          ev_http_status = DATA(http_status)
    ).

  CATCH zcx_adf_service.
ENDTRY.

IF http_status > 299.
  WRITE 'Fehler'.
ENDIF.

from abap-sdk-for-azure.

MartinPankraz avatar MartinPankraz commented on May 22, 2024

I recommend to reduce the problem space in your integration test by using a plain REST client first. Once you have a working request put the ABAP SDK to work for it. The simplest check is the Graph Explorer. See the endpoints here

from abap-sdk-for-azure.

PaddyCube avatar PaddyCube commented on May 22, 2024

Thanks for highlightning Graph. As SAP Developer, I'm not that familiar with all these MS products.

I had lots of issue to get it running with this SDK. For example, I had to use https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token, which seems not to be supported by this SDK. I tried with V1.0 tokens but they're not valid in Graph because the resource "resource": "00000002-0000-0000-c000-000000000000" of token is not valid for Graph

To fix this, I had to change method get_aad_token_clnt_cred of class zcl_adf_service_aad. I added an optional parameter iv_scope for scope as resource is not valid for V2.0 tokens. It only gets added to payload if filled.

Next, I enriched the class zcl_adf_service_graph and the interface by adding methods to read a SharePoint Site, all Lists of a site and all items of a list.

If you're interrested in my changes, I'll fork this repo and create a PR

from abap-sdk-for-azure.

MartinPankraz avatar MartinPankraz commented on May 22, 2024

Hey @PaddyCube,

a PR would be fantastic!

KR
Martin

from abap-sdk-for-azure.

PaddyCube avatar PaddyCube commented on May 22, 2024

Before creating a PR, I would like to discuss with you, where to store ClientID. In your example, you put it in description of RFC destination. It works but it is odd in my opinion. Description should not contain any data, it should just describe what the connection is good for.

In ZADF_CONFIG, you provide a configuration section for O365 applications. Here we can store ClientID. However you just provide a list of available applications. GRAPH is missing here. Is this the right place for you, should I add it here? Is Graph part of O365 or is it a separate product?
image

Other option I see is here. May we store CLientID either as Key/AAD or as Base URI (Base URI seems to be wrong imo)
image

What would you prefer?

from abap-sdk-for-azure.

vikasbansal2022 avatar vikasbansal2022 commented on May 22, 2024

Hi @PaddyCube ,

Key/AAD Column is used to store Secret/Key. Once you save that it gets encrypted and stored in table ZADF_CON_INDX.

Since Client ID is no secret, you can use usual SAP process to store in TVARV via SM30 against some variable and use that in your program code.

Hope it helps.

Regards,
Vikas

from abap-sdk-for-azure.

PaddyCube avatar PaddyCube commented on May 22, 2024

Thanks for your input.
I understand that ClientID in this case can't be stored in ZADF_CONFIG for given reasons.

Patrick

from abap-sdk-for-azure.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.