Code Monkey home page Code Monkey logo

Comments (6)

moberwasserlechner avatar moberwasserlechner commented on August 10, 2024

Are you sure that MS supports implicit flow for native apps? Please add the link to their docs.

Please debug into the plugin in XCode (search for the plugin class. It's there I debug that way myself) and see how far the call gets.

from generic-oauth2.

ibrahimsharif avatar ibrahimsharif commented on August 10, 2024

ms does support implicit flow ,

Im not using the plugin anymore ,

thanks

from generic-oauth2.

moberwasserlechner avatar moberwasserlechner commented on August 10, 2024

OK, but just out of curiosity. What do you use instead?

from generic-oauth2.

ibrahimsharif avatar ibrahimsharif commented on August 10, 2024

I am changing window location to

https://login.microsoftonline.com/{org-id}/oauth2/v2.0/authorize?client_id={AzureAD_APPID}&redirect_uri=http%3A%2F%2Fwebserverurl%3A8082&scope=user.readwrite&response_type=token&state=&prompt=login

then telling capacitor via cap.conf to allow redirection to ms loginpage inside "allowNavigation"
{ "server": { "url": "https://webserverurl.com", "allowNavigation": [ "sts.domain.dk", "login.microsoftonline.com" ] } }

then
I grab the token from the returned uri "/#access_token=*****" via

  parseTokenFromUrl(){
           const HashKeyValueParsed_JSON = {};
          window.location.hash.substring(1).split('&').forEach(function (x) {
            var arr = x.split('=');
            arr[1] && (HashKeyValueParsed_JSON[arr[0]] = arr[1]);
          });
removeHash(){
      let noHashURL = window.location.href.replace(/#.*$/, '');
      window.history.replaceState('', document.title, noHashURL)

currently I am not able to set the the redirectURI to a specific IOS app scheme as capacitor://localhost, capacitor just complaining inside the console that's it is not a valid https url

for now the app is just encapsulated inside IOS webView kind of PWA app,

I really want to use the plugin instead of having a webserver I will follow the task you created sorry because I closed it I did not know you are investigating and digging to resolve , I thugt I was alone here

/Ibrahim

from generic-oauth2.

moberwasserlechner avatar moberwasserlechner commented on August 10, 2024

Thanks for that. I hope to find some time to investigate further next weekend.

from generic-oauth2.

moberwasserlechner avatar moberwasserlechner commented on August 10, 2024

The original issue had nothing to do with fragment vs query response mode but with the fact that the plugin didn't return the access token, when no resourceUrl was configured.

This behavior will be introduced with version 2.0.0 of the plugin. see #75

from generic-oauth2.

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.