Coder Social home page Coder Social logo

Comments (7)

aycabas avatar aycabas commented on August 10, 2024 1

Hi @GeorgiaGit, I am sorry to hear that you are still facing an issue. Did you try to check the browser settings, it might be blocking the pop-up features. You may try to test the productivity dashboard by replacing the person component with the login component which will require a login without single sign on and bring the user profile info:

Login Component:
<mgt-login></mgt-login>

from teams-toolkit-samples.

WyldLynx avatar WyldLynx commented on August 10, 2024

By any chance did you work this out? I have the same scenario, appears to be connecting to graph ok, all scopes have been setup but nothing in the agenda, files and tasks - also checked that data exists.

from teams-toolkit-samples.

krchome avatar krchome commented on August 10, 2024

Thanks and I could not work this out after many tries. The MGT just renders the login component and that's all it does. I have now gievn up on this after wasting several hours on several days. I have communicated to the author on LinkedIn as well as a comment on her video on YouTube but still didn't get a suitable reply.

from teams-toolkit-samples.

aycabas avatar aycabas commented on August 10, 2024

Hi @krchome, if you didn't try before, can you please try to add a scopes in the provider and let me know if it works:

<script src="https://unpkg.com/@@microsoft/mgt/dist/bundle/mgt-loader.js"></script>
<script>
        mgt.Providers.globalProvider = new mgt.Msal2Provider({
            clientId: "@Configuration["TeamsFx:Authentication:ClientId"]",
            loginHint: "@User.Claims.FirstOrDefault(c => c.Type == "preferred_username")?.Value",
            redirectUri: "/blank-auth-end.html",
            loginType: mgt.LoginType.Popup,
            authority: "@Configuration["TeamsFx:Authentication:OAuthAuthority"]",
            scopes: ["User.Read", "User.ReadBasic.All", "Calendars.Read", "Files.Read", "Files.Read.All", "Sites.Read.All", "Tasks.Read", "Tasks.ReadWrite", "People.Read"]
        });
</script>

from teams-toolkit-samples.

GeorgiaGit avatar GeorgiaGit commented on August 10, 2024

I've injected the code above without any success.

In my case, I don't even get the logged in user

I've built the app using https://devblogs.microsoft.com/microsoft365dev/build-a-productivity-dashboard-with-microsoft-teams-toolkit-for-visual-studio/ and I've also cloned the app from GitHub.

I get the same behavior every time. I am never prompted to grant Graph permission so the mgt doesn't render.

I put a debugger statement after code snipped above. When it hits the break point, loginHint is empty "". Not sure if that matters.

loginHint: "@User.Claims.FirstOrDefault(c => c.Type == "preferred_username")?.Value",
returns ""

image

If I hardcode my user name, it has not effect.

from teams-toolkit-samples.

GeorgiaGit avatar GeorgiaGit commented on August 10, 2024

Ayca,

Thanks for taking the time to get back to me. Using the login component definitely helped with getting the sample operational!

Thank You!

I'll update once I find out the issue with mgt.LoginType.Popup. The browser doesn't seem to have an issue opening a pop-up when signing in using the control. Pop-Ups are allowed under settings in my browser as well.

from teams-toolkit-samples.

aycabas avatar aycabas commented on August 10, 2024

So glad login component helped @GeorgiaGit, keep me posted please if you find out what could be the reason it doesn't work through SSO without the login component.

from teams-toolkit-samples.

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.