---
title: "W5500 - http server - 401 Unauthorized How?"
url: "https://maker.wiznet.io/forum/13255"
markdown_url: "https://maker.wiznet.io/forum/13255/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "HikoSV"
created: "2019-03-28T02:15:15+09:00"
last_activity: "2019-03-29T21:20:54+09:00"
language: "en"
views: 765
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5500 - http server - 401 Unauthorized How?

## Question

Asked by HikoSV on 2019-03-28 in Ethernet Chips.

Hi, i’m using google translate…
Disassembled the example with wiz550web, transferred to the board.
Now the question is how to make standard HTTP authentication (login / password)? I understand the general sense that when connecting for the first time, the server should send something like this:

```
> Authorization const char [] = {
"HTTP / 1.1 401 Authorization Required \ r \ n"
"Server: MyServer \ r \ n"
"WWW-Authenticate: Basic realm = \" Cloud System \ "\ r \ n"
"Content Type: Text / html \ r \ n"
"Content Length: 169 \ r \ n \ r \ n"
"<HTML> \ r \ n <HEAD> \ r \ n <TITLE> Error </ TITLE> \ r \ n"
"<META HTTP-EQUIV = \" Content-Type \ "CONTENT = \" text / html; charset = ISO-8859-1 \ "> \ r \ n"
"</ HEAD> \ r \ n <BODY> <H1> 401 is not authorized. </ H1> </ BODY> \ r \ n </ HTML>"
};
```

But how to accept / process the answer, understand the password, etc.?
Is there a less complete example?

## Replies

### Reply 1 by Philipp K, 2019-03-28

I think your question is more HTTP-related than WizNet related.
Have a look at this:

[en.wikipedia.org](https://en.wikipedia.org/wiki/Basic_access_authentication)

### [Basic access authentication](https://en.wikipedia.org/wiki/Basic_access_authentication)

In the context of an HTTP transaction, basic access authentication is a method for an HTTP user agent (e.g. a web browser) to provide a user name and password when making a request. In basic HTTP authentication, a request contains a header field in the form of Authorization: Basic &lt;credentials>, where credentials is the Base64 encoding of ID and password joined by a single colon :. It was originally implemented by Ari Luotonen at CERN in 1993 and defined in the HTTP 1.0 specification in 1996. ...

Now, I don’t know much about HTTP, but as I see it, the client will return a request with an Authorization header, which contains the credentials. You can evaluate them and respond with 200 if everything is okay, or 401 or any other status code that fits

### Reply 2 by Mxyxixptlick, 2019-03-29

You’re correct, Philipp_K. The HTTP specs say, “HTTP access authentication is explained in “HTTP Authentication: Basic and Digest Access Authentication” [\[43\]](https://www.w3.org/Protocols/rfc2616/rfc2616-sec17.html#bib43)”

---

Source: https://maker.wiznet.io/forum/13255
