Coder Social home page Coder Social logo

Comments (6)

Billb12 avatar Billb12 commented on June 3, 2024 2

I neglected to configure the SPA correctly. With the changes we made and adding the Platform configuration correctly, it's working.

Thank you for the assistance, it is much appreciated.

from powervirtualagentssamples.

adilei avatar adilei commented on June 3, 2024 1

@Billb12 , I do know of instances where this has been deployed successfully in GCC. Let me see if I can find out what the configuration was and get back to you.

from powervirtualagentssamples.

adilei avatar adilei commented on June 3, 2024

@Billb12 , seems like the authority parameter in elements.xml should be set to https://login.microsoftonline.us/****.onmicrosoft.us

You shouldn't need to change anything in the code sample itself.

from powervirtualagentssamples.

Billb12 avatar Billb12 commented on June 3, 2024

Your suggestion wasn't successful.

We had to update login.microsoftonline.us/{XXXXXXtenantID} in the element.xml to move forward.

The next error we encountered required us to change the application code because our user logins do not match our emails.

We updated the application code in PvaSsoApplicationCustomizer to pass the loginName instead of the email.

const elem: React.ReactElement = React.createElement<IChatbotProps>(Chatbot, { ...this.properties, userEmail: user.loginName, userFriendlyName: user.displayName });

This allows us to get past the oauth2/v2.0/authorize request.

Now.. we are attempting to get a token, but failing because the code is passing the site collection url as the redirect_uri and the endpoint expects 'spa'

Error code as follows.

{"error":"invalid_request","error_description":"AADSTS9002326: Cross-origin token redemption is permitted only for the 'Single-Page Application' client-type. Request origin: 'https://XXXX.sharepoint.us'. Trace ID: 243e0a36-6739-4925-bece-116106730b00 Correlation ID: 0156891c-9292-41e7-8646-202887358dca Timestamp: 2024-03-13 16:14:12Z","error_codes":[9002326],"timestamp":"2024-03-13 16:14:12Z","trace_id":"243e0a36-6739-4925-bece-116106730b00","correlation_id":"0156891c-9292-41e7-8646-202887358dca","error_uri":"https://login.microsoftonline.us/error?code=9002326"}

Any advice is appreciated.

from powervirtualagentssamples.

adilei avatar adilei commented on June 3, 2024

What do you have as platform in your app registration? Not SPA?

Otherwise, good call regarding user.loginName, I'll change it in the repo

from powervirtualagentssamples.

adilei avatar adilei commented on June 3, 2024

Thanks for finding the issue with userEmail!

from powervirtualagentssamples.

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.