Comments (10)
@moberwasserlechner For now, I tried to login on iOS using the code similar to Google, but struggle to figure out how/what to set for redirect custom scheme (it replies with 400. Bad Request.
)
Also I wonder how to make it to redirect to the app instead of just web page. Maybe you have some hints...
from capacitor-oauth2.
Hi @leshik,
Unfortunatley I never heard of LINE before but if it is a valid oauth2 provider it should work.
- Does it work in a pwa using this plugin?
- Have registered your custom scheme at the provider's registration page?
- Could you please share your config (without the appId or any other secret data)?
- Is there anything non standard in the LINE flow?
The idea of this plugin to be as generic as possible and let you configure oauth2 providers instead of integrating the various providers with a special API.
from capacitor-oauth2.
@moberwasserlechner Unfortunately we don't have the PWA version of the app, so I have to make it work with iOS and Android versions. I've set up the configuration options at LINE's side (except the Callback URL
as I want it to redirect into the app) as per their documentation, using the app bundle identifier in place of iOS/Android scheme. Then tried the code similar to your Google example in Safari console after starting the app:
Capacitor.Plugins.OAuth2Client.authenticate({
appId: "XXXXXXXXXX", // LINE channel id
authorizationBaseUrl: "https://access.line.me/oauth2/v2.1/authorize",
accessTokenEndpoint: "https://api.line.me/oauth2/v2.1/token",
scope: "profile",
resourceUrl: "https://api.line.me/v2/profile",
ios: {
responseType: "code",
customScheme: "myapp.bundle.id:/"
}
})
Of course, it didn't work with the error that I've mentioned before. The reason, obviously, is that redirect_uri
is the required parameter:
(state
is also required, but I understand how to deal with it).
Is it correct that I need to include their SDK and write a customHandler if I want it to authenticate through their app instead of webview? Anyway, I have no idea what to do with the redirect_uri
requirement.
from capacitor-oauth2.
For state
there is a option. see https://github.com/moberwasserlechner/capacitor-oauth2/blob/master/src/definitions.ts#L54
Maybe I can introduce a new parameter ios.redirect_url
beside the customScheme
.
I have to look closer but don't have the time right now.
If they do not allow redirecting to the app like google oauth does and they force you to use their SDK you might have to choose the Facebook approach.
from capacitor-oauth2.
I was able to make it work on iOS with their SDK, but struggle with Android. Contrary to what Facebook API provide, seems that Line API doesn't have any ready-to-use activity that can be integrated.
from capacitor-oauth2.
@moberwasserlechner Here I found the implementation for Cordova, but could you please advise on how to deal with the OAuth2CustomHandler?
from capacitor-oauth2.
Sry that I did not had the time to help you further. Did you solve it or is it still an issue?
from capacitor-oauth2.
Well, it's still an issue but not of high priority right now, and surely it's due to my lack of knowledge on Android programming. I hope somebody in our team with Java background would help me to solve it, and I will share the solution then once it's available.
from capacitor-oauth2.
Thanks for that in advance. :)
from capacitor-oauth2.
I close this for now as it might be solved with v2.0.0.
from capacitor-oauth2.
Related Issues (20)
- Problem opening native authenticator app HOT 1
- How to get Refresh Token with windowTarget: "_self". HOT 3
- Call back function is not returning the value
- ERR_STATES_NOT_MATCH
- HELP: Getting "USER_CANCELLED" error with Google oAuth2 in Android Simulator HOT 1
- Tweaks for using with Spotify OAuth HOT 2
- Feat: Integration with trapeze to improve configuration
- Auth0 HOT 1
- Bug: Intent filter not working for redirection after login HOT 2
- Feat: Support Android 13 HOT 2
- Support for Capacitor 5 HOT 10
- Is there a way to get a login prompt? HOT 1
- Azure B2C ui_locales is directly supported via the auth request builder exception HOT 2
- I am not able to hide URL bar HOT 2
- accessTokenEndpoint quirk with django backend HOT 1
- Google with android says "Custom scheme URIs are not allowed for 'WEB' client type" HOT 3
- App Store Connect Issue
- Hide navigation bar and footer on iOS HOT 5
- Evidence of the use of safari
- Question: What kind of browser is used for login? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capacitor-oauth2.