Giter VIP home page Giter VIP logo

Comments (9)

felipeschneider88 avatar felipeschneider88 commented on July 17, 2024 1

Hello @waldekmastykarz , I will send the video tomorrow. I'm facing problems with the Office add-in to consume the web API so I will share the idea on the video. I'm not sure if I will fix it before the deadline and I prefer to share what I have

from hack-together.

felipeschneider88 avatar felipeschneider88 commented on July 17, 2024 1

I have uploaded the presentation video now, in a couple of hours I will be submitting the demo video too

from hack-together.

felipeschneider88 avatar felipeschneider88 commented on July 17, 2024 1

Introduction video
Introduction video

Demo video
Demo video

from hack-together.

waldekmastykarz avatar waldekmastykarz commented on July 17, 2024

Awesome! Could you also submit the companion Office add-in? It would be awesome to see it in action end to end 😊

from hack-together.

waldekmastykarz avatar waldekmastykarz commented on July 17, 2024

Hey @felipeschneider88, would you mind recording a short video walkthrough of your hack? Any format will work. It's not required for the hackathon but it would help us showcase your work both internally at Microsoft and publicly in the community. 😊

from hack-together.

waldekmastykarz avatar waldekmastykarz commented on July 17, 2024

Could you please share any more information about what's not working with the add-in? Perhaps we could help you fix the issue.

from hack-together.

felipeschneider88 avatar felipeschneider88 commented on July 17, 2024

Yes, Today the app is built with 2 projects. One is the web API that interact with the Microsoft graph, it has the business logic on it.

The second is an Office add-in project that uses the SSO option to get the logged user. I was able to get information about the logged user in Excel. I was also able to get info from an URL that doesn't need auth

const element = document.querySelector('#product-name');
fetch('https://testapi.jasonwatmore.com/products/1)
    .then(response => response.json())
    .then(data => element.innerHTML = data.name);

But when I tried to get a token from the SSO to call the web API It fails

This is the code I'm using on the Excel Add-in:

async function getCalendar() {
  let userTokenEncoded = await OfficeRuntime.auth.getAccessToken({
    allowSignInPrompt: true,
    allowConsentPrompt: true,
    forMSGraphAccess: true,
  });  
  const element = document.getElementById("item-subject");
  let path = 'https://localhost:7068/calendar'
  $.ajax({
		url: path,
		method: "GET",
		headers: {
			"Authorization" : "Bearer " + userTokenEncoded
		},
		success: function(response) {
			element.innerHTML = response.json();
		}
	});
}

from hack-together.

waldekmastykarz avatar waldekmastykarz commented on July 17, 2024

Do I understand it correctly that your API is rejecting your token? Have you tried looking into the token at https://jwt.ms to see to which audience it's issued and if that audience is valid with your API?

from hack-together.

felipeschneider88 avatar felipeschneider88 commented on July 17, 2024

Hello, I have checked and the audience is the same (both apps are using the same AD registered in azure) with id
22969033-cb4f-4019-b265-fd9e8056f2ff

from hack-together.

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.