-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]: How can I build authorize url #1638
Comments
So what you can do is you can login with this lib with the normal |
@FabianGosebrink Thanks for the reply. |
You can pass an url handler, handling the call to the IDP and then use capacitors browser plugin https://capacitorjs.com/docs/apis/browser. Have you tried that? |
Hello I tried with browser plugin to load urls but I am not getting how to bind this in IDP case, could you please provide with some sample code for above suggestion to try . Thanks in advance. |
I do not have any sample code for your specific issue. What do you mean with "bind this in IDP case"? You can pass an URL handler in the authOptions in the .authorize() method. In this, you can call the Browser plugin from capacitor. This is what I would try :) https://angular-auth-oidc-client.com/docs/documentation/login-logout#authoptions |
import { Browser } from '@capacitor/browser'; const openCapacitorSite = async () => { In above code sample,"url" needs to be passed for Browser.open(), so in my case to integrate the IDP "url" needs to be passed to the Browser plugin I passed in this way this.oidcSecurityService.authorize(undefined, { where "redirectUrl" is the redirect url mentioned in the config file , but after building the app and running its crashing and not opening the login page |
You have to pass the url of the IDP. Auth0 in this case. |
Hello I am using identity server 4 for that and when I try calling its endpoint on Browser.open({url:'https://xx.xx.x/connect/authorize'}) I am facing this error Can you @FabianGosebrink please help me with this should could be better way of calling the identity server url with authorize() method this.oidcSecurityService.authorize(undefined, { |
Hi @JyotiP10 You do not implement part of the flow inside the native app. You should open a browser, begin the flow from the browser and then return the tokens to the app when the authentication flow is complete. The redirctUrls are host dependent and need to be configured on the IDP. You need to let the lib redirect because it adds the required params which are dynamic and validated when the flow completes. Greetings Damien |
Hello , Thanks for the brief explanation! @damienbod Actually what I am trying is to open the IDP server link from in-app browser so in case of capacitor we need to provide below code in "capacitor.config.json" file to open the link inside the app browser, } This opens the IDP link (in my case IS4 login page) inside the application chrome browser , now after providing the login details and clicking the login button the request for endpoint https://xx.xx.x/connect/authorize' fails with error Could you please suggest a way to solve this issue @FabianGosebrink . |
Library version: "angular-auth-oidc-client": "^15.0.2",
Question
How can I create authorize url for this library.
Usecase: I am trying to implement capacitor in-app browser (https://capacitorjs.com/docs/apis/browser) feature for my pure angular based web application.
My intention is to open the sts link inside the android application created with the help of capacitor and Im trying to take reference with the auth0 sample application(https://auth0.com/docs/quickstart/native/ionic-angular/interactive) .
This snapshot shows the build the authorize url and then pass that to Browser plugin . Similarly I want to take help of above library to build the url and then pass that to the Browser plugin.
@damienbod and @FabianGosebrink please help to get this issue resolved.
The text was updated successfully, but these errors were encountered: