Skip to content

Bearer Authentication #988

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

Merged
merged 1 commit into from
Nov 17, 2015
Merged

Bearer Authentication #988

merged 1 commit into from
Nov 17, 2015

Conversation

lelemm
Copy link
Contributor

@lelemm lelemm commented Oct 9, 2015

Started using this lib and really liked, but it was missing bearer authentication (need for my project). Added support to it.

Added Bearer Authentication
@smarek
Copy link
Member

smarek commented Oct 9, 2015

Thanks, is that code copy pasted solution from https://stackoverflow.com/questions/20146557/how-to-access-bearer-authenticated-service-from-android ? If so, we have to credit the guy.

Also I have to check if this doesn't break other auth methods, have you tried ?

@lelemm
Copy link
Contributor Author

lelemm commented Oct 9, 2015

yes, the code if from "Dave G". I just adapted the calls to this project
I tried basic auth, nothing changed. still working


AuthSchemeRegistry authSchemeRegistry = new AuthSchemeRegistry();
authSchemeRegistry.register("Bearer", new BearerAuthSchemeFactory());
context.setAttribute(ClientContext.AUTHSCHEME_REGISTRY, authSchemeRegistry);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this line, it means we're overriding any AUTHSCHEME_REGISTRY already contained by underlying HttpContext ? This should be enabled on-demand, not as only AuthScheme available from library

@smarek
Copy link
Member

smarek commented Nov 17, 2015

I'll fix the comments after merging

smarek added a commit that referenced this pull request Nov 17, 2015
@smarek smarek merged commit c36c45b into android-async-http:master Nov 17, 2015
@smarek smarek added this to the 1.4.9.1 milestone Nov 17, 2015
@smarek smarek self-assigned this Nov 17, 2015
smarek added a commit that referenced this pull request Nov 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants