Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
angular2-http-auth
Advanced tools
Angular authenticated HTTP requests (no JWT required).
Inspired by angular2-jwt
npm install angular2-http-auth
This is the configuration file. You can pass it default fixed headers as well as dynamic headers (such as the authorization token).
Make sure to import this module prior doing any authenticated HTTP call.
app.module.ts
is often a good place to import it.
import { AuthHttp, AuthConfig } from 'angular2-http-auth';
export function authHttpServiceFactory(
http: Http,
tokenIsHereService: OptionalServiceThatProvidesTheAuthorizationToken,
) {
return new AuthHttp(new AuthConfig({
headers: {
'Content-Type': 'application/json',
Authorization: () => tokenIsHereService.authorizationKey,
},
}), http);
}
@NgModule({
providers: [
{
provide: AuthHttp,
useFactory: authHttpServiceFactory,
deps: [Http, OptionalServiceThatProvidesTheAuthorizationToken]
}
]
})
export class AuthHttpModule { }
It is very similar to angular2-jwt's, even though some parameters might be different.
import { HttpModule } from '@angular/http';
import { AuthHttpModule } from './auth-http.module';
@NgModule({
imports: [
...
HttpModule,
AuthHttpModule,
...
],
import { AuthHttp } from 'angular2-http-auth';
...
fetchPrivateStuff(): Observable<Response> {
return this.authHttp.post(`https://my-site.com/privateStuff`, {});
}
MIT © Gerard Rovira Sánchez
FAQs
Angular HTTP Auth
The npm package angular2-http-auth receives a total of 0 weekly downloads. As such, angular2-http-auth popularity was classified as not popular.
We found that angular2-http-auth demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.