-
Notifications
You must be signed in to change notification settings - Fork 116
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
Azure B2C - redirect uri provided in the request is not registered for the client id #96
Comments
Have a look at #91. Try the proposed steps there to debug your problem. BR |
@moberwasserlechner I did take a look an followed the steps in there (unless I missed something) but till the same problem. It seems a bit weird but I do get this on the error: |
Try this:
strings.xml:
AndroidManifest:
build.gradle:
Azure portal:
|
In your example you do not use the value reference from Therefore changing the value in You have <data android:scheme="com.cads.testapp" android:host="oauth" /> instead of <data android:scheme="@string/custom_url_scheme" android:host="oauth" /> The I'll try to clearify that in the README. |
@loonix Could you plz have a look at this README section I tried to clearify a few things based on this task and the input from @fredbjork |
You are right, could probably just remove the value in strings.xml if you dont use it in AndroidManifest. |
@moberwasserlechner made a comment on the change @fredbjork thanks forsharing the code but it seems that has not made any change to me I still get that error unfortunately :( |
I still haven't managed to get it to work but I have created an example of implementation of azure b2c, maybe its easier to see the code https://github.com/loonix/capacitor-oauth2-azure-example |
The repo looks good. Everything is there, so I really don't know why it does not work. |
@fredbjork will try that, what type of app did you register on azure? |
@fredbjork @moberwasserlechner many thanks for your help, it seems that it was a typo on theredirectUrl that triggered that, after looking closer that was the issue @moberwasserlechner please feel free to link my capacitor example to your readme-file as it is working well PS: the / escape I think it is due to the json encoding that outputs that to the terminal.. |
for anyone experiencing the issue BAD REQUEST just make sure you add the code in MainActivity.java ... Other imports
import com.byteowls.capacitor.oauth2.OAuth2ClientPlugin; // <-- this
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initializes the Bridge
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
// Additional plugins you've installed go here
// Ex: add(TotallyAwesomePlugin.class);
add(OAuth2ClientPlugin.class); // <-- this
}});
}
} |
@loonix I'm glad you solved your config issue. Don't get me wrong but I try to prevent such tasks with documentation in the README. So just one final question: There was no bug in the plugin or in the documentation. If you had followed the Android section in the README and did not had the typo in your config everything would be fine? |
The problem was not the specification (although it did helped when you added the paths for placing the changes in the right place) it was really a typo on azure configuration. Documentation looks good, I created a fresh repo just to be easier to isolate the issue I was having. When I have the IOS version working as well I will update the code so it gets easier for someone else that comes across this. Sorry for all the questions and thanks for the help from both. |
@loonix Thx for the answer and for the repo. I linked it here and copied your config as another example for azure b2c. PS: My comment was not meant to be offending in any kind. Your questions helped to make the docs more helpful, especially for devs, that are new to Capacitor and OAuth. |
Hey, is your logout function working? I am trying and it seems that it does not work with Azure.
|
The current logout function is not what you expect. It simply cleans any cached tokens but does not log you out of the provider. For that to work you would have to provide a logout url, which is not supported (yet). But you can create a new feature request task and I try to include that in one of the upcoming releases, but I can't give you a timeline. |
@loonix Is this issue ready to close? The logout feature request got its own task. Did you had any issues on iOS? |
I still haven't tested, but feed free to close it, I will reopen if there is an issue. Thanks |
But could you plz open a new issue in case of a iOS problem. With all the discussion in this one it is would be hard to keep track of the new problem. thx |
Description
Hi guys, I am able to login using the web configs but when I try to login on android it seems that it is not working for me, would be great if someone can give me some help with this.
Steps
Chrome Inspector:
Android Studio:
Capacitor version:
2.1.0
Library version:
2.0.0
OAuth Provider:
Azure B2C
Your Plugin Configuration
Notes:
I have checked the azure settings and I have configured the Custom Redirect URI to
com.cads.testapp://oauth/redirect
but still am facing this issue.If I change the following:
It opens the login page and redirects to the app but does not give any error, but it does not pass any parameter either
EDIT:
it seems that the redirect URI add a backslash before :
The redirect URI 'com.cads.testapp:\/\/oauth\/redirect' provided in the request is not registered for the client id
Has anyone came across this issue, or knows a way to fix this? Many thanks for the awesome plugin!
The text was updated successfully, but these errors were encountered: